web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Filtering an array wit...
Power Automate
Answered

Filtering an array with an array.

(0) ShareShare
ReportReport
Posted on by 2

Good day,

I'm working through a request to create an email subscription list.  

 

We have a large number of legal related documents in a document library that are tagged with a multi-value choice field. 

For example, it could be any one or more of "benefits, "payroll", "tax", "other" (in reality we have dozens of tags and a document can be tagged with one or several of them)

As an example here is a test table that has three entries
"HR Manual.doc"   ["benefits", "payroll"]
"Tax Numbers.xlsx" ["payroll, "tax"]
"Policy.pdf" ["other"]


I then have a subsciption list with user names and a copy of the tag field, for documents they'd like updates on:
Barry  ["benefits", "other" ]
Jane ["payroll", "tax", "other"]
John ["other"]

 

The idea then is that Barry would never be notified on changes to the Tax Numbers document.  John, would only be notified on changes to the Policy record and Jane would get a notification for all three records.


On a high level I see this working as such:

For Each User
- Get user's subscription preferences.

- Fetch the document library and filter it down to matches on the subscription preference. 
- For Each document match

- - check for edits and build an email body.

- End For each

- Email out the compiled list

End For each.

 

I see a lot of examples on how to filter an array on one item, but I cannot find anything on filtering an array with another array.

 

Any suggestions are welcome. 

 

Regards,

Barry

Categories:
  • v-bacao-msft Profile Picture
    Microsoft Employee on at

     

    Hi @BKHolmes ,

     

    Could you illustrate your needs with screenshots?

    I am afraid that although you have provided a lot of descriptions, I have not figured out your needs.

    In addition to filtering an array with another array, it seems that you need to use two Apply to each, like:

    25.PNG

     

    Best Regards,

  • BKHolmes Profile Picture
    2 on at

    @v-bacao-msft  Please find an example flow attached that should help illustrate what I'm trying to do.

     

    Flow Array Filter.png

  • Verified answer
    v-bacao-msft Profile Picture
    Microsoft Employee on at

     

    Hi @BKHolmes ,

     

    From your description, you want to determine if the corresponding categories are equal and then send the file.

    You could configure your Flow by following the instructions below. The main thing to do is to use variables to get the category value contained in each item/file property.

    Then iterate through the list and Library to compare.

    Image reference:

    66.PNG

    Details of Apply to each:

    67.PNG

     

    Details of Apply to each 3

    68.PNG

    Details of Condition:

    69.PNG

    Hope it helps.

     

    Best Regards,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 377

#2
11manish Profile Picture

11manish 302 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 130

Last 30 days Overall leaderboard