英文:
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.
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”操作之前。
我的演示结果:
Excel数据
SharePoint列表数据:
运行流程后,列表如下:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论