Return structured data in FQL
You can use Flows Query Language (FQL) to transform one JSON object into another, differently structured, JSON object. This topic provides example FQL expressions that show different ways of structuring the JSON output of an Evaluate block in Postman Flows.
To try out the examples, add a Record input to the Start block in your flow. Connect an Evaluate block to the Start block. In the Evaluate block’s dropdown menu, select FQL. Paste an example FQL expression into the Evaluate block. Then create a scenario and paste the following example JSON into the scenario field that corresponds to your Start block’s input.
Untitled
Click to view example JSON
When you run the flow, the expression will operate on the example JSON and the Evaluate block will output the result.
Return multiple objects as an array
To return an array containing three of the top-level objects in the example JSON, use the following expression:
Return an array of a single field from multiple objects
To return an array containing only the values of the city key from the three top-level address objects in the example JSON, use the following expression:
Collapse multiple objects into a single key-value pair
FQL can return an array of key-value pairs composed of values from an object. To get the values of the type and number keys from objects in the phones array and return them as an array of key-value pairs, use the following expression:
Collapse and group results by a shared field value
FQL can return an array that groups the values of a given key that’s present in multiple input objects. To group the values of Cell keys from two different objects in the phones array, use the following expression: