Tutorials/Power Apps/From Flow to App: Transforming JSON with ParseJSON
Power Appsintermediate

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.

NA
Narmer Abader
@narmer · Published June 3, 2026

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 NameData TypeNotes
TaskNameSingle line textDescription of the task
AssignedToSingle line textPerson responsible
DueDateDate onlyDeadline
CompletedYes/NoTask 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 keyOutput column
TaskNameTaskName
AssignedToAssignedTo
DueDateDueDate
CompletedCompleted

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:

powerfxOnSelect of the button
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().result returns the plain‑text output from the flow.
  • ParseJSON(...) converts that text into an untyped object.
  • .body extracts the array of records.
  • Table() ensures the result is treated as a table inside ForAll.
  • For each untyped record (Value), we use type constructors (Text, DateValue, Boolean) to produce typed columns in the collection colProjectTasks.

Add a Vertical gallery and set its Items to colProjectTasks. Inside the gallery, place a label for each column:

powerfxLabel's Text property (example for TaskName)
ThisItem.TaskName

Repeat for AssignedTo, DueDate, and Completed. For the date, format it if needed:

powerfxFormatted DueDate
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.
  • ParseJSON itself 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 ForAll is 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

  1. Forgetting .bodyParseJSON returns the root object. If you omit .body you’ll try to loop over an object instead of an array. Always check the schema from your test run.
  2. 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.
  3. Wrong type constructor – Using Text() on a date field creates a string, not a date. Use DateValue() to get a true date that can be sorted or formatted.
  4. Null values – If a field is empty in SharePoint, Text(Value.SomeField) can fail. Wrap it with Coalesce or If(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