web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : g/cO+p9p4JpJ+ueo4ChM2I
Power Automate - Building Flows
Answered

How i can check if a property does not exists inside Parsed JSON file

Like (0) ShareShare
ReportReport
Posted on 27 Mar 2024 20:34:58 by 1,566 Super User 2024 Season 1

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

  • jrussi1301 Profile Picture
    38 on 26 Nov 2024 at 21:10:25
    How i can check if a property does not exists inside Parsed JSON file
    try:
     
    coalesce(items('Apply_to_each')?['OOH_price_list']?['Grand_Total'],null)
  • DJ_Jamba Profile Picture
    2,832 Super User 2025 Season 2 on 28 Mar 2024 at 12:44:33
    Re: How i can check if a property does not exists inside Parsed JSON file

    Good stuff - glad it worked!

    d(-_-)b

  • johnjohnPter Profile Picture
    1,566 Super User 2024 Season 1 on 28 Mar 2024 at 12:39:50
    Re: How i can check if a property does not exists inside Parsed JSON file

    @DJ_Jamba ok it worked

  • DJ_Jamba Profile Picture
    2,832 Super User 2025 Season 2 on 27 Mar 2024 at 21:46:20
    Re: How i can check if a property does not exists inside Parsed JSON file

    @johnjohnPter  - Did it work??

    If so - can you mark as solution 😁

  • Verified answer
    DJ_Jamba Profile Picture
    2,832 Super User 2025 Season 2 on 27 Mar 2024 at 20:48:50
    Re: How i can check if a property does not exists inside Parsed JSON file

    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']
    )

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading complete