Hi community,
I'm building a flow to insert HTTP GET response into an Excel file hosted in Sharepoint. I managed to correctly load an array of values, and also the values inside a children array. Having so, I'm struggling to handle a missing property inside the children array, as not all my record contain the same children array properties. I get the following error: "Unable to process template language expressions in action 'Add_a_row_into_a_table' inputs at line '1' and column '10857': 'The template language expression 'if(contains(item()?['metadata']['PointOfSaleName']), item()?['metadata']['PointOfSaleName'], 'null')' cannot be evaluated because property 'PointOfSaleName' doesn't exist"
Here is my flow:

As an example of my JSON file, this could be the format of a standard record:
"data": [
{
"id": 123456,
"metadata": {
"PointOfSaleName": "Test1",
"BookingReference": "TR000"
}
},
{
"id": 789123,
"metadata": {
"BookingReference": "TX000"
}
}
]
As you can see, the second record does not contain the property "PointOfSaleName".
In order to map an excel column to the "PointOfSaleName" property I use item()['metadata']['PointOfSaleName']. When the "Apply to each" reaches the second record it fails, pointing out that "PointOfSaleName" does not exist.
I've tried applying an if function to convert to null when the property is missing, but it keeps giving me the same error.
Thanks for supporting here!