cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

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

 

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
Community Support

 

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.

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

 

Flow Array Filter.png

 

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
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (82,169)