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
Good stuff - glad it worked!
d(-_-)b
@johnjohnPter - Did it work??
If so - can you mark as solution 😁
Hi @johnjohnPter
If you try to access the path like this:
items('Apply_to_each')['OOH_price_list']['Grand_Total']
It means, evaluate ['OOH_price_list'] because it is definitely there and evaluate ['Grand_Total'] because it is definitely there, so you will get an error if it's not there.
If you access the path like this:
items('Apply_to_each')?['OOH_price_list']?['Grand_Total']
The question mark ? means evaluate if it's there.
Try:
if(
equals(
items('Apply_to_each')?['OOH_price_list']?['Grand_Total'],
null
),
null,
items('Apply_to_each')?['OOH_price_list']?['Grand_Total']
)
Tomac
986
Moderator
stampcoin
699
Super User 2025 Season 2
Riyaz_riz11
577
Super User 2025 Season 2