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 Apps / Handling JSON Input fr...
Power Apps
Unanswered

Handling JSON Input from Power Automate: Single vs. Multiple Records in Power Apps

(0) ShareShare
ReportReport
Posted on by 2

I am working with JSON data from a Power Automate Flow that converts XML to JSON. The JSON structure contains an owner field, which sometimes appears as:

  • A single object (when there's only one owner)
  • An array of objects (when multiple owners exist)

This inconsistency causes errors when using ForAll() in Power Apps because Power Apps treats a single object as a record and multiple as a table.

JSON Input Example

Single Owner (Object)

 
 
{
"fieldAudit": {
"employer": {
"ownershipVerification": {
"owner": {
"valid": true,
"isFromRecords": true,
"person": {
"zipCode": "12345",
"state": "NY",
"ssn": "1111",
"country": "USA",
"telephone": "555-1234",
"city": "New York",
"addressLine1": "123 Main St",
"title": {
"label": "Manager",
"type": "Admin",
"code": "MGR"
},
"firstName": "John",
"lastName": "Doe",
"middle": "A"
}
}
}
}
}
}

Multiple Owners (Array)

{
"fieldAudit": {
"employer": {
"ownershipVerification": {
"owner": [
{
"valid": true,
"isFromRecords": true,
"person": {
"zipCode": "12345",
"state": "NY",
"ssn": "1111",
"country": "USA",
"telephone": "555-1234",
"city": "New York",
"addressLine1": "123 Main St",
"title": {
"label": "Manager",
"type": "Admin",
"code": "MGR"
},
"firstName": "John",
"lastName": "Doe",
"middle": "A"
}
},
{
"valid": true,
"isFromRecords": true,
"person": {
"zipCode": "67890",
"state": "CA",
"ssn": "2222",
"country": "USA",
"telephone": "555-5678",
"city": "Los Angeles",
"addressLine1": "456 Park Ave",
"title": {
"label": "Supervisor",
"type": "Operations",
"code": "SUP"
},
"firstName": "Jane",
"lastName": "Smith",
"middle": "B"
}
}
]
}
}
}
}

PowerApps Issue

When we try to loop over ParsedData.fieldAudit.employer.ownershipVerification.owner using ForAll(), we get an error if the owner is a single object. PowerApps treats it as a record instead of a table. Set(ParsedData,ParseJSON(JsonString)) 

Requirement is I wanted to reconstruct the Json for download the json after modification.

Categories:
I have the same question (0)
  • realwillwright Profile Picture
    772 Moderator on at
    Hi,
     
    A bit hacky but you could do a substitute, to convert the single JSON into an array. You might need to do some fiddling with the "s
     
    Substitute(Substitute("""owner:"" {", """owner:"" {"), "}}}}}}", "}}]}}}}")
     
    Alternatively you could use IfError to process the data if it errors in the ForAll. this enables you to set up 2 methods of processing.
     
    Please click Accept as the Answer ✅
     
    If my post helped you solve your issue. This will help others find it more readily. It also closes the item. Remember, you can accept more than one post as a solution. If the content was useful in other ways, please consider giving it a Like 👍

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 Apps

#1
Valantis Profile Picture

Valantis 426

#2
WarrenBelz Profile Picture

WarrenBelz 381 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 315 Super User 2026 Season 1

Last 30 days Overall leaderboard