How to retrieve a List out of json array in Postman Flows

Hi.

I am trying to build a workflow with postman flows and I retrieve weather data from an API giving me an array (properties.periods is the json path for the array)

I would like to show now for each entry in the array certain values (properties.periods.name or properties.periods.temperature) and this as a List in flow…

I tried to create a list with select and set the path, but this sets me properties.periods.0.name, which shows me only the first value of the array in the list.

How to stream the response of the API into a list (or even a table)?

The only example I found were with a pre-defined / hard coded list as input for a list output or table output.

Thanks very much

Hi @bygones123

Welcome to the forums!

You can achieve this in the evaluate block instead of a select block:


The Evaluate block uses FQL which allows you to do more advanced things than an select block.

You can stream it to a table with all the values in the list of objects by selecting “Table” on an output block:

Let me know if this solves what you’re trying to do.

1 Like

Hi @flows-daniel

thank you very much for your quick and comprehensive answer.

It does indeed solve my problem of getting results out. Awesome what this can do.

Is it also possible to filter with FQL the response json object? Like from the n keys in the object, I only want 2-3 specific ones?!


like - i only want “shortForecast”,“name” and “temperature”?

@bygones123

Yes, you can construct a new JSON object with just 2-3 fields and return the list of those new JSON objects.

properties.periods.{"name": name,"temp": temp, etc.}
1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.