Forum Discussion
Handling Empty Results
- Anonymous9 years ago
LON,
Change your code as follows. And maybe you would need to change List.IsEmpty(content) part in the following code to List.IsEmpty(Source) or List.IsEmpty(body), you can test it.let Source = Json.Document(Web.Contents("https://xxxxxxxxxxxxx", [Headers=[zzzzz="xxxxxx"]])), body = Source[body], content = body[content], #"Converted to Table" = Table.FromList(content, Splitter.SplitByNothing(), null, null, ExtraValues.Error), Table1=Table.FromRecords({ [Column1 = ""] }), result= if List.IsEmpty(content) then Table1 else #"Converted to Table" in result
Regards,
Hi Anonymous
Thanks - yes it would be great if you could elaborate please..
Would the idea be something like having another table with a zero value in it and having the report take that value and display it if the query did not return any data and hence there was no table created from the json (ie when there were no issues found by the query)?
Best Regards
Liam
That could be one approach.
I'm not too sure what will work as I'm not sitting directly with your problem, but the approach would be to insert 0 when nothing is found. I hope this makes sense.
- LON9 years agoHelper I
Thanks very much Martin - Im learning so much from this forum.
Best Regards
Liam