Hi,
I have looked at this solution: JSON missing property
But I just can't seem to get to work it for my solution.
My flow is as follows:
HTTP GET
Parse JSON (Body)
Update row
In the update row I use objects from my retrieved JSON, however, in some cases some objects are not available. Therefore the flow gives the following error:
Unable to process template language expressions in action 'Update_a_row' inputs at line '0' and column '0': 'The template language expression 'if(empty(body('Parse_JSON')?['quotes']?[0]['industry']),' ',body('Parse_JSON')?['quotes']?[0]['industry'])' cannot be evaluated because property 'industry' doesn't exist, available properties are 'exchange, shortname, quoteType, symbol, index, score, typeDisp, longname, exchDisp, isYahooFinance'. Please see https://aka.ms/logicexpressions for usage details.'.
I have tried these expressions, but all do not work:
- if(equals(body('Parse_JSON')?['quotes']?[0]['industry'],null),' ',body('Parse_JSON')?['quotes']?[0]['industry'])
- if(empty(body('Parse_JSON')?['quotes']?[0]['industry']),' ',body('Parse_JSON')?['quotes']?[0]['industry'])
- if(empty(body('Parse_JSON')['quotes'][0]['industry']),' ',body('Parse_JSON')['quotes'][0]['industry'])
(The [0] is retrieve only the first item of the array in the JSON.)
Do I do something incorrectly with the question marks? Or is it something else?
Thanks in advance!