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