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 Automate
Answered

JSON missing property

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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:

biswedishdevil_1-1630355651529.png

 

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!

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous :

    Please try :

    if(
     equals(items('Apply_to_each')?['metadata']?['PointOfSaleName'],null),
     ' ',
     items('Apply_to_each')?['metadata']?['PointOfSaleName']
    )

     instead of 

    items('Apply_to_each')?['metadata']?['PointOfSaleName']

     I'v made a test for your reference:

    vbofengmsft_0-1630377285614.png

    vbofengmsft_1-1630377303874.png

    The Result:

    I replaced the non-existent value with a null value, and the flow is running normally,

    vbofengmsft_2-1630377332575.png

    Best Regards,

    Bof

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @v-bofeng-msft ,

     

    Many thanks for taking the time to support me, it works 100% 🙂

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 442

#2
Vish WR Profile Picture

Vish WR 328

#3
David_MA Profile Picture

David_MA 268 Super User 2026 Season 1

Last 30 days Overall leaderboard