“I don’t see the dynamic content output from the Power Automate ‘Filter array’ action, all I see are the values from the action before the filter was applied.”
‘Filter array’ is a Power Automate action you use if you can’t filter directly in the ‘Get…’ action. If the OData Filter query is not available or can’t be used for any reason, ‘Filter array’ is the action to use instead. But there’s a small problem with this action: it doesn’t keep the schema of the original array. It doesn’t matter how many dynamic content values the original array had, ‘Filter array’ might reduce them to two. It’ll display only ‘Body’ (the filtered array) and ‘Item’ (the objects themselves). How can you use the values from the filtered array then?
Add ‘Parse JSON’ to rebuild the schema
The simplest way is to add back the array schema using the ‘Parse JSON’ action. As already described in a previous post, take the ‘Filter array’ output and use it as the sample JSON payload. Power Automate will create a schema from the sample automatically. Then just input the ‘Body’ output into the action Content.
The dynamic content will be available again as the output from the ‘Parse JSON’.
Summary
I consider ‘Filter array’ one of the key actions in Power Automate. I believe you should always filter instead of using conditions, but not all Power Automate actions allow you to use OData Filter query. Sometimes you must get all items and filter them later, e.g. when working with MS Teams or Planner. Or when filtering by an unsupported column in SharePoint, e.g. multiple lines of text.
But don’t let the missing dynamic content force you to replace the ‘Filter array’ with a ‘Condition’. If it’s not available, add the ‘Parse JSON’ action and create the schema again.
Hi Team,
In last step, dynamic content was not available as the output from the ‘Parse JSON’.
Hello Mohit,
the output is based on the JSON schema, if the schema is defined, the dynamic content should correspond to it. Also, if you need only a specific value from the JSON, you can extract it using an expression: https://tomriha.com/how-to-get-a-specific-value-from-a-json-object-in-power-automate/
Awesome, this helped a lot and works great! Thank you.
Thanks for this – super helpful