Skip to content

Create a list from JSON data

In Power Automate Desktop, you add actions by dragging and dropping them in the GUI, but internally, flows are built in a programming language called Robin.

Because of this, variables have several data types, and you can handle JSON data flexibly.

This article explains how to create list data from JSON data.

Details of the “Convert JSON to custom object” action

Section titled “Details of the “Convert JSON to custom object” action”

This article uses the “Convert JSON to custom object” action.

The action is explained in detail on this page.

This action is normally used to create a custom object with multiple properties, but if you pass JSON data that represents an array, you can create list data instead.

As a sample, this article uses a flow that creates list data from JSON data.

Copy the following code and paste it into the Power Automate Desktop flow designer to add the action.

Variables.ConvertJsonToCustomObject Json: $'''%'[\"a\", \"b\"]'%''' CustomObject=> JsonAsArray
  1. In “Search actions”, type “Convert JSON to custom object”.

  2. Set the parameters as follows.

    Parameter Value
    JSON %‘["a", "b"]’%
    Variables produced %JsonAsArray%
  3. When you run the flow, list data is created from the JSON data.

If the specified JSON data is invalid, an error (“Error parsing the JSON”) occurs during parsing.

We recommend adding error handling with an “On block error” block.