Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

power query

Hi All,   Am taking data from API and while doing it some time the table is empty so while refreshing the data am getting error that the column is not found since am expanding the column in later s...
  • Ahmedx's avatar
    Ahmedx
    2 years ago

    pls try this

    let
    Source = Json.Document(Web.Contents("https://api.pilot.io/api/v1")),
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), {"getFile"}, null, ExtraValues.Error),
    custom= if Table.IsEmpty(#"Converted to Table") then Dummy_Table else #"Converted to Table",
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "getFile", {"region", "active_connections", "max_active_connections", "days_to_check", "uuid", "potential_savings", "type"})
    in
    #"Expanded Column1"