I have a CDS Entity which has 2x Boolean (Yes/No) metadata fields which I need to filter independently.
My first step is to List the Records and then initialize an array variable with the items.
My first condition is looks up an option set field and depending on the result, I either Filter the Array for the first Boolean or do nothing.
My second condition then looks up another option set and again depending on the result, I either Filter the previous conditions data or again do nothing.
My first filter works fine but my second filter doesn't want to filter an already filtered array variable. Is this possible?
Solved! Go to Solution.
Hi @sammybridge,
Ok, it is correct. It should work if the column name is correct.
Let us change a method to test. How about using the expression to filter? Click the "Edit in advanced mode", then input the following expression:
@equals(item()?['Column_Name'], true)
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
HI @sammybridge ,
Can you please share your screenshot of the output , also please ensure when you are listing records you are pulling all the required attributes for filter to work.
Thanks
Hi @sammybridge,
I think the reason why the second condition not works is the Filter array action is not correct, on the left side, you could use the expression to extract the value you want to filter:
item()?['column_Name']
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-litu-msft ,
This is what I have in the left hand side. It goes in as an expression but when I save my flow it updates to look like I have selected it from the dynamic choices.
Thanks
Hi @sammybridge,
Ok, this situation indeed occur sometimes.
How does the send filter query look like? Is it an empty output or not-filtered?
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @sammybridge,
If it is not filtered means all items satisfied the condition, you could create a simple instance to test it, for example:
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-litu-msft this is incorrect. When I swap my filters around and put my second filter first, it filters on this one correctly. It is only filtering on the first filter and missing the second one.
Hi @sammybridge,
Could you please peek code of the second filter action?
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @sammybridge,
Ok, it is correct. It should work if the column name is correct.
Let us change a method to test. How about using the expression to filter? Click the "Edit in advanced mode", then input the following expression:
@equals(item()?['Column_Name'], true)
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-litu-msft
This now looks like it is working for some reason. I took the code out and replaced it back in and it is working.
Thanks for your help
Check out new user group experience and if you are a leader please create your group
See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.