Hello Everyone!
I'm working to try and build a "Digest List" as a part of a process we are trying to improve. We have a directory of SharePoint Sites in our environment and each site has two contacts associated with it (Let's call them Contact 1 and Contact 2). A person can be the contact for multiple sites.
Every year we have users validate their sites are still needed. I want to query through our directory of sites where the site is not validated. I want to build out an email so I send one email to a contact with all of their sites that aren't validated (instead of them getting multiple emails they receive just one).
Initially I tried just creating items in a list with a contact column and a site id column. I queried my directory list to get all unvalidated sites. I check my digest list to see if the contact exist, if it doesn't I create an entry for them, if they do exist I just append the site id to the site id column in the digest list.
However, the items get created in batches, so you run into the issue where you create multiple items for a single contact, but they really should only have one entry in the digest list. I tried adding a Commit Changes action but that didn't help.
Next I was going to try using a collection doing something similar. However, I couldn't find a way to replace an item at a certain index. Basically I could check if the contact exist in the collection, if they do get the index, then update my collection with SiteIDs at that specific index. Is there a way to replace a value in a collection at an index?