I am working on a Power Apps application where I need to handle data returned from an API dynamically. The API response contains nested JSON objects, arrays, and sometimes objects within arrays. The challenge is that the structure of the JSON can change over time, making it impractical to hardcode field names or manually map properties.
Here are two examples of the API response structures I receive:
Example 1:
{
"content": [
{
"name": "Marywood University",
"alpha_two_code": "US",
"domains": ["marywood.edu"],
"country": "United States",
"web_pages": ["https://www.google.com"],
"state-province": null
},
{
"name": "Lindenwood University",
"alpha_two_code": "US",
"domains": ["lindenwood.edu"],
"country": "United States",
"web_pages": ["https://www.google.com"],
"state-province": null
}
]
}
Example 2:
{
"results": [
{
"gender": "female",
"name": {
"title": "Ms",
"first": "Jessica",
"last": "Perry"
},
"location": {
"street": {
"number": 8932,
"name": "Manor Road"
},
"city": "Kilcoole",
"state": "Meath",
"country": "Ireland"
},
"email": "jessica.perry@example.com"
}
]
}
-
Tried Flattening in Power Apps:
- I used functions like
ParseJSON,Table, andForAllto dynamically extract the properties of the JSON. However, Power Apps lacks native support for iterating over object properties or handling arrays within nested JSON dynamically.
- I used functions like
-
Tried Key-Value Pair Mapping:
- I attempted to extract key-value pairs from the JSON using nested
ForAllloops, but encountered errors likeName isn't validorText function has invalid argumentswhen processing dynamic fields likePropertyNameandPropertyValue.
- I attempted to extract key-value pairs from the JSON using nested
Expected Outcome:
I want to create a solution where Power Apps can dynamically process JSON data (including nested objects and arrays), regardless of the structure, and display it in a gallery or collection without requiring manual adjustments each time the API changes.


Report
All responses (
Answers (