Forum Discussion
efilipe
6 years agoHelper IV
PowerQuery if null then Skip
Hi all,
I want to call an API but if returns nothing the Expanded Column1 give me an error. If there a way to skip it?
let
Source = Json.Document(Web.Contents("https://api.site.com/api-public/report/query/2?datainicial=2020-05-01&datafinal=2020-05-31 23:59:59"), 65001),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"created_date", "video_id", "tag_id", "watched_1s_app", "watched_3s_app", "skip_0s_app", "total_impressions", "time_watched", "time_watched_without_push", "time_watched_from_push", "likes", "favorites", "shares", "searches", "%_watched_10", "%_watched_10_25", "%_watched_25_50", "%_watched_50_75", "%_watched_75_100"}, {"created_date", "video_id", "tag_id", "watched_1s_app", "watched_3s_app", "skip_0s_app", "total_impressions", "time_watched", "time_watched_without_push", "time_watched_from_push", "likes", "favorites", "shares", "searches", "%_watched_10", "%_watched_10_25", "%_watched_25_50", "%_watched_50_75", "%_watched_75_100"})
in
#"Expanded Column1"
Another thing is that I use those result, to each month, to merge into a single table. I dont know if this is going to be a headache later, if I just skip the next step.
Any ideas?
Thanks!
1 Reply
- parry2kSuper User
efilipe you can use try otherwise, check these posts:
https://docs.microsoft.com/en-us/power-query/handlingerrors
https://blog.gbrueckl.at/2013/12/error-handling-in-power-query/
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!