Reputation: 299
I have a SharePoint list that contains approximately 15000 records. My list has an Owner field for each record. There can be many owners of many different records. However, there can be only one owner per record. Each day people access this list and make updates depending on the record. I would like my script to run every evening and send an email to each owner with a list of the records that they own that were modified. So if one or more records that I own are modified, then I want to be notified at the end of the day with an email that has a link to the records that were modified. Similarly, if some records of 5 different owners were modified today, then they would each receive an email listing the records that they own that were modified.
I know how to compare a record's Modified field to today's date using the formatdatetime(utcNow(), 'MM-dd') functions. I'm currently experiencing 2 issues. The get items action in Power Automate relies on the SharePoint REST API and that only return 5000 rows at a time, so my results are missing 10K of rows. So, I need to figure out how to overcome that limitation. Also, I haven't figured out a best way to send out emails to the different record owners displaying only the records that they own. I currently send out a mass email with all the modified records - this is inefficient and not a pleasant experience for those receiving these mass emails.
Any help would be greatly appreciated, even if it includes restructuring or setting up indexes on my list, all responses will be considered.
Upvotes: 0
Views: 698
Reputation: 35970
With a slightly different mind set, you may get a much easier solution.
People have an obligation to do their job. If they don't do that, it's more a behavioural problem, not a technical one.
Saying that, you don't have to loop through all 15000 records. You only need to loop through the ones that were changed Today. If you get fewer than the threshold changes per day, you could:
Upvotes: 0