cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lokdawg78
Frequent Visitor

Help with flow creating duplicate items

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.flow1.pngflow2.pngflow3.pngflow4.png

1 REPLY 1
tom_riha
Super User
Super User

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



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (3,665)