cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kenneth0596
Advocate II
Advocate II

An array in Filter Query

Hi, I want to filter items using an array variable from another list. The query would be something like this: client eq 'a' or client eq 'b' or client eq 'c' ... where list of clients comes from another sharepoint. Any ideas? 

3 REPLIES 3
ScottShearer
Super User
Super User

@kenneth0596 

You can't use an array in your filter query.  I suggest using a string variable.  Loop through the array and append

client eq '[current array value here]'  or   

in each loop.

In the last loop, don't add the or at the end.

Substitute the current value in the array from Dynamic properties for [current array value here].

 

In my example, please note that there is a space after or in the append to string action.

image.pngimage.pngimage.png

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Swiftx64
New Member

Hey,

 

Thank you for sharing this, I am trying to follow along but having an issue.

 

Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The inputs of template action 'Append_to_string_variable' at line '1 and column '2469' is invalid. Action 'Apply_to_each' must be a parent 'foreach' scope of action 'Append_to_string_variable' to be referenced by 'repeatItems' or 'items' functions.'.'."

 

What would cause that error?

 

https://powerusers.microsoft.com/t5/Building-Flows/Action-Apply-to-each-must-be-a-parent-foreach-sco...

Thanks a lot for your solution. That worked for me.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (3,789)