Hey,
I completely understand your frustration. You are running into a hard boundary of how Power Fx handles untyped objects.
The short answer is: Power Apps cannot natively iterate over unknown JSON keys.
While the ParseJSON() function successfully creates an untyped object, Power Apps does not have a "reflection" function (like Object.keys() in JavaScript) to dynamically read the property names. To extract data from an untyped object, the platform strictly requires you to hardcode the dot-notation path (e.g., Value.name.first).
To achieve your expected outcome, you must transform that dynamic JSON into a predictable schema before it is parsed by your Canvas App.
The Solution: Standardized Key-Value Arrays
You need a middleman (typically a Power Automate flow) to intercept the API response and flatten the nested, unpredictable JSON into a strict array of Key/Value pairs.
Instead of returning the raw API response to Power Apps, use a flow to flatten the payload. Because Power Automate also struggles with dynamic keys natively, the easiest way to do this is by passing the JSON into an "Execute JavaScript Code" action (Premium) or through a Custom Connector using a simple script. If you haven't set up JS in a flow before,here is an excellent step-by-step guide on how to execute JavaScript in Power Automate.
You want the script to traverse the JSON and output a flat array formatted exactly like this:
[
{ "Property": "name.title", "Value": "Ms" },
{ "Property": "name.first", "Value": "Jessica" },
{ "Property": "location.city", "Value": "Kilcoole" },
{ "Property": "email", "Value": "jessica.perry@example.com" }
]
Once your flow returns this structured, standardized array to Power Apps, your app's dynamic processing becomes effortless.
You simply load that array into a collection and point your Gallery to it. You only need two text labels in the gallery: ThisItem.Property and ThisItem.Value.
Using this method, if the API changes tomorrow and adds 20 new nested fields, your Canvas App requires zero manual adjustments. The flow's script will automatically catch the new fields, convert them into new rows in the array, and your gallery will seamlessly populate them.
✅ If this helps solve the issue, please mark it as a Verified Answer so others facing a similar issue can find it easily. Thanks!!