From Flow to App: Transforming JSON with ParseJSON
Learn how to convert a text string returned by Power Automate into a structured collection using the ParseJSON function.
When building canvas apps that rely on Power Automate, you often hit a wall: the only way a flow can return data to your app is as a plain text string. The ParseJSON function demolishes that wall by converting that text into an untyped object that you can reshape into a typed table or record. In this guide, you’ll build an app that retrieves a project‑task list from SharePoint via a flow, transforms the JSON output into a collection, and displays it in a gallery — all with clean, typed data.
Your Scenario: Project Task Tracker
Imagine a team that needs a quick dashboard of all open tasks from a SharePoint list. The app will trigger a flow, pull the relevant columns, and show them in a gallery. You’ll create a SharePoint list named Project Tasks with these columns:
| Column Name | Data Type | Notes |
|---|---|---|
| TaskName | Single line text | Description of the task |
| AssignedTo | Single line text | Person responsible |
| DueDate | Date only | Deadline |
| Completed | Yes/No | Task status |
Add a handful of sample rows — for instance, “Design login screen”, “Set up CI/CD”, “Write unit tests” — with realistic dates and statuses.
Step 1: Build the Flow
Inside Power Apps Studio, navigate to the Power Automate tab and create a new flow from blank. Name it GetProjectTasks.
Add a Get Items action for your SharePoint list.
- Turn on Pagination in the action settings and set the threshold to 5000 (the maximum). This avoids the default 100‑item limit.
You don’t need every system column, so add a Data Operations – Select action after Get Items. Map the fields you want:
| Input key | Output column |
|---|---|
| TaskName | TaskName |
| AssignedTo | AssignedTo |
| DueDate | DueDate |
| Completed | Completed |
Finally, place a Respond to a PowerApp or flow action. Add a text output named Result and set its value to the output of the Select action:
outputs('Select') // or the dynamic name of your Select step
Save the flow. In Power Apps the flow will be available as GetProjectTasks.
Step 2: Discover the JSON Schema
Before using ParseJSON, you need to know what shape the flow returns. Run a test manually from the Power Automate maker portal, then inspect the outputs of the Respond action. You’ll see a JSON object like this:
{
"body": [
{
"TaskName": "Design login screen",
"AssignedTo": "Alice",
"DueDate": "2025-09-15",
"Completed": false
},
...
]
}
The important part: the result arrives as a text string, but its structure is an object with a body property that contains an array of records. The ParseJSON function will treat that string as an untyped object, and you’ll then access .body to get the list.
Step 3: Write the ParseJSON Code
Add a button to your app screen (e.g., label “Load Tasks”). In its OnSelect property, run the flow and convert the result:
ClearCollect(
colProjectTasks,
ForAll(
Table(ParseJSON(GetProjectTasks.Run().result).body),
{
TaskName: Text(Value.TaskName),
AssignedTo: Text(Value.AssignedTo),
DueDate: DateValue(Value.DueDate),
Completed: Boolean(Value.Completed)
}
)
)Explanation:
GetProjectTasks.Run().resultreturns the plain‑text output from the flow.ParseJSON(...)converts that text into an untyped object..bodyextracts the array of records.Table()ensures the result is treated as a table insideForAll.- For each untyped record (
Value), we use type constructors (Text,DateValue,Boolean) to produce typed columns in the collectioncolProjectTasks.
Step 4: Display in a Gallery
Add a Vertical gallery and set its Items to colProjectTasks. Inside the gallery, place a label for each column:
ThisItem.TaskName
Repeat for AssignedTo, DueDate, and Completed. For the date, format it if needed:
Text(ThisItem.DueDate, "dd/mm/yyyy")
Add a header row above the gallery with static labels naming the columns. Your app now works end‑to‑end.
Performance & Delegation Notes
- Pagination in the flow ensures you can fetch up to 5,000 items. Beyond that, consider filtering the list inside the flow (e.g., a date range) to keep the payload manageable.
ParseJSONitself is not subject to delegation—it runs entirely on the client. The size of the JSON string can affect app load and memory. Keep returned rows under a few thousand.- Converting every record with
ForAllis client‑side and works quickly for reasonable datasets. For very large lists, perform the transformation inside the flow using Data Operations – Compose and return pre‑typed JSON (though it will still be text on the wire).
Common Mistakes & Troubleshooting
- Forgetting
.body–ParseJSONreturns the root object. If you omit.bodyyou’ll try to loop over an object instead of an array. Always check the schema from your test run. - Column name mismatches – If a column in SharePoint contains spaces (e.g., “Task Name”), you must refer to it with the exact internal name or escape it with single quotes.
- Wrong type constructor – Using
Text()on a date field creates a string, not a date. UseDateValue()to get a true date that can be sorted or formatted. - Null values – If a field is empty in SharePoint,
Text(Value.SomeField)can fail. Wrap it withCoalesceorIf(IsBlank(...), ...).
Recommendation
The ParseJSON function is the cleanest way to shape flow data in Power Apps today. Always test your flow to capture the exact schema, and use explicit type constructors for each column. Keep the returned data volume reasonable, and your app will stay fast and maintainable.
References
- Original source article: Power Apps ParseJSON Function: Get Collection From A Flow
- Microsoft Docs: ParseJSON function
- Microsoft Docs: Untyped objects and type constructors
- Microsoft Docs: Respond to PowerApp action