I am parsing a JSON list with this schema:-
{
"type": "array",
"items": {
"type": "object",
"properties": {
"Brand": {
"type": [
"string",
"null"
]
},
"OOH_price_list": {
"type": "object",
"properties": {
"Net_Total": {
"type": [
"string",
"null"
]
},
"SalesTax": {},
"Grand_Total": {
"type": [
"string",
"null"
]
},
"Total": {
"type": [
"string",
"null"
]
},
"DIscount": {
"type": [
"string",
"null"
]
}
}
},
"BR_price_list": {
"type": "object",
"properties": {
"Net_Total": {
"type": [
"string",
"null"
]
},
"Grand_Total": {
"type": [
"string",
"null"
]
},
"Amount_In_Words": {
"type": [
"string",
"null"
]
},
"Sales_Tax": {
"type": [
"string",
"null"
]
}
}
},
"OOH_media_list": {
"type": "array",
"items": {
"type": "object",
"properties": {
"Network": {
"type": [
"string",
"null"
]
},
"Amount": {
"type": [
"string",
"null"
]
},
"Duration": {
"type": [
"string",
"null"
]
},
"of_Faces": {
"type": [
"string",
"null"
]
},
"Start_Date": {
"type": [
"string",
"null"
]
},
"End_Date": {
"type": [
"string",
"null"
]
},
"Delivery Date": {
"type": [
"string",
"null"
]
}
},
"required": [
"Network",
"Amount",
"Duration",
"of_Faces",
"Start_Date",
"End_Date",
"Delivery Date"
]
}
},
"blue_river_list": {
"type": "array",
"items": {
"type": "object",
"properties": {
"Network": {
"type": [
"string",
"null"
]
},
"Amount": {
"type": [
"string",
"null"
]
},
"Cost_Face": {
"type": [
"string",
"null"
]
},
"of_Faces": {
"type": [
"string",
"null"
]
},
"Start_Date": {
"type": [
"string",
"null"
]
}
},
"required": [
"Network",
"Amount",
"Cost_Face",
"of_Faces",
"Start_Date"
]
}
},
"Contract_Number": {
"type": [
"string",
"null"
]
},
"Client Name": {
"type": [
"string",
"null"
]
},
"Sector": {
"type": [
"string",
"null"
]
},
"No of Faces": {
"type": [
"string",
"null"
]
},
"Sales Person Name": {
"type": [
"string",
"null"
]
},
"Sales Person Email": {
"type": [
"string",
"null"
]
}
},
"required": [
]
}
}
now i want to get the following property named "Grand_Total":-
if(empty(items('Apply_to_each')['OOH_price_list']),null,items('Apply_to_each')['OOH_price_list']['Grand_Total'])
but on some items i am getting this error:-
'if(empty(items('Apply_to_each')['OOH_price_list']),null,items('Apply_to_each')['OOH_price_list']['Grand_Total'])' cannot be evaluated because property 'OOH_price_list' doesn't exist, available properties are 'Brand, BR_price_list, OOH_media_list, Category, Sales Person Email, blue_river_list, Contract_Number, Client Name, Sector, No of Faces, Blue River, Sales Person Name'.
so how i can check if the OOH_price_list is there to get its properties? seems empty function will not work