Forum Discussion
stew_ia
6 years agoFrequent Visitor
JSON with empty array
I'm working with a 3rd party REST API that returns an empty Results array when all of the data has been consumed. "Results":[] This seems like it should be easy enough but it has me stumped. I'...
- 6 years ago
That did it JirkaZ, prolem solved.
Results2 = if (Record.HasFields(Results1{0}, {"Id"})) then Results1 else null
JirkaZ
6 years agoSolution Specialist
stew_ia Not sure from the top of my head but Json.Document typically returns a record, correct? So you could test the record with Record.HasFields perhaps?
stew_ia
6 years agoFrequent Visitor
That did it JirkaZ, prolem solved.
Results2 = if (Record.HasFields(Results1{0}, {"Id"})) then Results1 else null