Hello everyone, I'm having issues with Power Automate creating duplicate list items. I'm just trying to pull in new messages from Twilio but every time it creates duplicates of existing messages. I am trying to use the SID of the text message as a unique identifier. When a message to our Twilio number comes in, I want the flow to look at the SID and if it exists in the SharePoint list it ignores it, if it does not exist then it creates a new item with the text message info. But when I run the flow it just creates duplicate items of all messages over and over until cancelled. I'm sure this is an easy fix and I'm just not as well versed to see it. I added screenshots of my flow.
Hello @lokdawg78 ,
it's probably caused by the 'Apply to each 2', in that loop you're looping through all the messages (output of the 'List Messages' action) for each item in the list.
Instead of looping through all of them and evaluating them in the condition try to use the 'Filter array', similar to the this post. For each item (the first 'Apply to each') filter only the message with the corresponding id. If it exists, do nothing, otherwise create it.
User | Count |
---|---|
88 | |
37 | |
26 | |
13 | |
13 |
User | Count |
---|---|
127 | |
54 | |
37 | |
24 | |
21 |