Power Automate – 比较 SharePoint 列表与 Excel 文件并删除现有数值

huangapple go评论157阅读模式
英文:

Power Automate - Compare SharePoint List with Excel file and delete existing values

问题

我有一个Excel文件,其中有一列,我们称之为MemberName。我有一个SharePoint列表,只有一列,我想使用Excel文件来更新它。我打算遍历SharePoint列中的值,将其与Excel列进行比较,如果匹配则删除SharePoint中的值(即如果在Excel中找到'Aaron',则从SharePoint中删除'Aaron')。

根据以下内容,我已尝试在SharePoint列表上启动循环(从Get Items输出的“value”开始)。然后,我嵌套了一个循环来迭代在表中的行中的“value”输出。

条件将“items('Apply to each')”与“items('Apply to each 2')”进行比较 - 我认为这部分没问题。

条件输出部分应该获取当前SharePoint值的ID,然后将其传递给Delete item函数。但我完全无法让它工作(循环似乎永远不会结束...)

英文:

I have an Excel file that has a single column; let's call this MemberName. I have a SharePoint List, with a single column, that I want to update using the Excel file. I am intending to loop through the values in the SharePoint column, compare these to the Excel column, and delete the SharePoint values if they match (i.e. delete 'Aaron' from SharePoint if 'Aaron' is found in Excel).

Per the following, I have tried starting the loop on the SharePoint list ("value" output from Get Items). I've then nested a loop to iterate over "value" output from List rows present in a table.

The condition takes "items('Apply to each')" and checks if it is equal to "items('Apply to each 2')" - I think that this bit is OK.

Power Automate – 比较 SharePoint 列表与 Excel 文件并删除现有数值

The condition output aspect should then get the ID of the current SharePoint value, and then pass this to the Delete item function. I can't get this to work at all (the loop seems to go on forever...)

答案1

得分: 0

你可以尝试将“获取项目”操作放在“应用于每个2”操作之前。

我的演示供您参考:
Power Automate – 比较 SharePoint 列表与 Excel 文件并删除现有数值

我的演示结果:
Excel数据

Power Automate – 比较 SharePoint 列表与 Excel 文件并删除现有数值

SharePoint列表数据:

Power Automate – 比较 SharePoint 列表与 Excel 文件并删除现有数值

运行流程后,列表如下:

Power Automate – 比较 SharePoint 列表与 Excel 文件并删除现有数值

英文:

You can try to put "Get Item" action before "Apply to each 2" action.

My demo for your reference:
Power Automate – 比较 SharePoint 列表与 Excel 文件并删除现有数值

My Demo result:<br>
Excel data

Power Automate – 比较 SharePoint 列表与 Excel 文件并删除现有数值

SharePoint List data:

Power Automate – 比较 SharePoint 列表与 Excel 文件并删除现有数值

After running the flow, the list is like:

Power Automate – 比较 SharePoint 列表与 Excel 文件并删除现有数值

huangapple
  • 本文由 发表于 2023年6月21日 22:49:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/76524597.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定