cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BKHolmes
Level: Powered On

Filtering an array with an array.

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

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Filtering an array with an array.

 

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,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Community Support Team
Community Support Team

Re: Filtering an array with an array.

 

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,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BKHolmes
Level: Powered On

Re: Filtering an array with an array.

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

 

Flow Array Filter.png

Community Support Team
Community Support Team

Re: Filtering an array with an array.

 

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,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,573)