我如何使用电源自动化流程在SharePoint列表中检查所有15K行

发布于 2025-01-30 09:51:41 字数 802 浏览 2 评论 0原文

我有一个大约15000个记录的SharePoint列表。我的列表都有每个记录的所有者字段。可能有许多不同记录的所有者。但是,每个记录只能只有一个所有者。每天人们访问此列表并根据记录进行更新。我希望我的脚本每天晚上运行,并向每个所有者发送一封电子邮件,其中包含他们所拥有的记录列表。 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.

我知道如何使用FormatDateTime(utcnow(),'MM-DD')功能将记录的修改后字段与今天的日期进行比较。我目前正在遇到2期。 Power Automate中的GET项目操作依赖于SharePoint REST API,并且一次仅返回5000行,因此我的结果缺少10K行。因此,我需要弄清楚如何克服这一限制。另外,我还没有找到一种将电子邮件发送给仅显示其拥有记录的不同记录所有者的最佳方法。我目前向所有修改后的记录发送了一封大规模电子邮件 - 对于那些收到这些大规模电子邮件的人来说,这是效率低下的经历,这不是一个令人愉快的经历。

即使它包括重组或在我的列表上设置索引,所有帮助也将不胜感激,也将考虑所有响应。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

咽泪装欢 2025-02-06 09:51:41

通过略有不同的思维设置,您可能会得到更轻松的解决方案。

  • 创建一个由所有者= [me]过滤的视图,并通过修改,下降进行排序。
  • 让人们定期检查此观点。

人们有义务完成工作。如果他们不这样做,那就是一个行为问题,而不是技术问题。

话虽如此,您不必循环浏览所有15000个记录。您只需要循环浏览今天已更改的循环。如果您每天的阈值更改要少,则可以:

  • 获取项目并使用ODATA过滤器通过修改=今天过滤,并按所有者进行订单,然后用所有者
  • 初始所有者变量,然后
  • 通过“ get”项目结果进行空字符串循环
    • 将目前所有者变量设置为该项目的所有者电子邮件
    • 如果以前的所有者变量<>当前所有者变量
      • 启动电子邮件并将列表变量放入电子邮件主体
      • 将电子邮件发送到以前的所有者变量(除非仍然是空字符串)
      • 清除列表变量
    • 将以前的所有者变量设置为=当前所有者变量
    • 将项目详细信息附加到列表变量
  • 循环端

With a slightly different mind set, you may get a much easier solution.

  • Create a view that is filtered by Owner = [Me] and sort it by modified, descending.
  • let people check this view regularly.

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:

  • Get Items and use the OData filter to filter by Modified = today and sort order by owner
  • initialise previous owner variable with empty string
  • loop through the Get Items results
    • set current owner variable to the item's owner email
    • if previous owner variable <> current owner variable
      • start an email and put the list variable in the email body
      • send the email to the previous owner variable (unless it's still the empty string)
      • clear the list variable
    • set the previous owner variable to be = current owner variable
    • append the item details to the list variable
  • loop end
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文