“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
Has there been a change in the last few years? The situation that I have is I have a “List rows present in a table” action, that I then use a Filter Array on. (When I look at the output of the Filter Array, it does have several rows from my spreadsheet.) When I then try to do the Parse JSON, I get the following error: Unable to process template language expressions in action ‘Parse_JSON’ inputs at line ‘0’ and column ‘0’: ‘The template language expression ‘outputs(‘MyFilterArray’)[‘body/value’]’ cannot be evaluated because property ‘body/value’ doesn’t exist, available properties are ‘body’. Please see https://aka.ms/logicexpressions for usage details.’. This is essentially the same error, I get if I simply try to do an apply to each off of the Filter Array. Not sure what I am doing wrong, but it is driving me crazy. Any help would be appreciated.