Showing results for 
Search instead for 
Did you mean: 
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

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

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (2,137)