Forum Discussion

efilipe's avatar
efilipe
Helper IV
6 years ago

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!