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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Check if a property/ke...
Power Automate
Answered

Check if a property/key exists in JSON output

(0) ShareShare
ReportReport
Posted on by 183

I'm using "Invoke HTTP Trigger" action in my flow. Sometimes, this action returns JSON response without some keys.

Could someone help on how to check if keys like  locationUri, locationType exist in the JSON response. 

 

Condition contains(outputs('Invoke_an_HTTP_request'),'locationUri'did not help.

 

JSON Response

"location": {
"displayName": "",
"locationUri": "",
"locationType": "conferenceRoom",
"uniqueId": "",
"uniqueIdType": "directory",
"address": {
"street": "",
"city": "",
"state": "",
"countryOrRegion": "",
"postalCode": ""
},
"coordinates": {}
},
"locations": [
{
"displayName": "",
"locationUri": "",
"locationType": "conferenceRoom",
"uniqueId": "",
"uniqueIdType": "directory",
"address": {
"street": "",
"city": "",
"state": "",
"countryOrRegion": "",
"postalCode": ""
},
"coordinates": {}
}
],

Categories:
I have the same question (0)
  • djc998 Profile Picture
    16 on at

    I have this same problem. How do we handle if a property does not exist? In my example, I always get this error.

     

    InvalidTemplate. Unable to process template language expressions in action 'CurrentHealth' inputs at line '1' and column '2931': 'The template language expression 'if(empty(variables('trackerRows').cells[9].value),variables('trackerRows').cells[9].value,'null')' cannot be evaluated because property 'value' doesn't exist, available properties are 'columnId'. Please see https://aka.ms/logicexpressions for usage details.'.
  • djc998 Profile Picture
    16 on at

    I was able to solve the problem by using an if and then contains. This should solve your issue.

     

    if(contains(variables('trackerRows').cells[9], 'value'), variables('trackerRows').cells[9].value, 'null')
  • Verified answer
    v-bacao-msft Profile Picture
    Microsoft Employee on at

     

    Hi @sunithav ,

     

    You can try to use the property name in Compose to get the property value. If Compose fails, it means that the property does not exist.

    https://flow.microsoft.com/en-us/blog/error-handling/

     

    80.PNG

    Hope this helps.

     

    Best Regards,

  • CU20081036-0 Profile Picture
    183 on at

    Hi @v-bacao-msft ,

     

    Thanks for your response.

     

    I converted JSON response to string and used condition to check if string contains the required keyword.

     

    Thanks,

    SV

  • MartinPyman Profile Picture
    29 on at

    A slightly more elegant solution:

    Use the equals function in a condition step equal to false

     

    Example:

    equals( variables('JSON')?['<Property to Find>'] , null)
     
    MartinPyman_0-1659080609094.png

     

  • PabloD Profile Picture
    62 on at

    Very nice! Thank you.

  • jensweiltoyota Profile Picture
    4 on at

    Good try but it does not work. You can't access a property that does not exist. 

  • MartinPyman Profile Picture
    29 on at

    Flow running successfully and property marked as not existing:

     

    MartinPyman_0-1671551613780.png

     

    Here is the formula, I'm looking for "bob" which definitely is not in my json object:

     

    MartinPyman_61-1671551696144.png

     

    Did you give it a try? It'd be great to see why yours might be failing

     

  • 3tsolutions Profile Picture
    94 on at

    I wrote a solution to handle missing properties of an object, if it helps

    LINK

  • bookworm2death Profile Picture
    3 on at

    Make sure you have that ? between the variable and the property, mine didn't work until I noticed I missed that.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 557

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 264 Super User 2026 Season 1

Last 30 days Overall leaderboard