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

Syncing Data on 2 Sharepoint Lists - Flow Is Caught in Loop and Keeps Creating the Same Record

I have two sharepoint lists.

 

I want users to beable to create items on List A and have said item also created on List B.

I also need Vice-versea functionality. If an item is created on List B, it should automatically be created on List A as well.

 

My problem is that my flows are getting caught in a loop when I create an  item on either list. If I create an item on either list, the Flows just keep pingponging off each other and starts an infinite loop of creating the same item over and over again on both list.

 

Does any have a solution to stop this duplication? My flows are attached. Break the loop 🙂

 

FLOW #1
Flow1.jpg

 

FLOW #2

Flow2.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Syncing Data on 2 Sharepoint Lists - Flow Is Caught in Loop and Keeps Creating the Same Record

Hi @josh99smith,

 

You should check if the item is exist in another list when you want to create the item in the another list.

 

I have made a test on my side to create an item in test4 list when an item is created in test3 list if the item isn't exist in test4 list,

And the sane item in test3 and test4 list would have the same Title.

 

You could refer to screenshot below to create the flow:

Capture.PNG

 

 Capture.PNG

 

You could refer to my screenshot flow to create the two flows to achieve your needs.

Please let me know if your problem could be solved.

 

 

Best regards,

Alice

View solution in original post

4 REPLIES 4
Highlighted
Super User III
Super User III

Re: Syncing Data on 2 Sharepoint Lists - Flow Is Caught in Loop and Keeps Creating the Same Record

I suggest having a column in each list with a default value specific to the list.  When a Flow starts, check that value in an if statement and decide whether the Flow should continue.

 

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Highlighted
Community Support
Community Support

Re: Syncing Data on 2 Sharepoint Lists - Flow Is Caught in Loop and Keeps Creating the Same Record

Hi @josh99smith,

 

You should check if the item is exist in another list when you want to create the item in the another list.

 

I have made a test on my side to create an item in test4 list when an item is created in test3 list if the item isn't exist in test4 list,

And the sane item in test3 and test4 list would have the same Title.

 

You could refer to screenshot below to create the flow:

Capture.PNG

 

 Capture.PNG

 

You could refer to my screenshot flow to create the two flows to achieve your needs.

Please let me know if your problem could be solved.

 

 

Best regards,

Alice

View solution in original post

Highlighted
Administrator
Administrator

Re: Syncing Data on 2 Sharepoint Lists - Flow Is Caught in Loop and Keeps Creating the Same Record

Hey, @josh99smith!

 

Thank you for posting on the Flow Community Forum! It appears as though @v-yuazh-msft would like some more information in order to further assist you properly with your issue. Please share any additional information that was requested in order to decrease the amount of time that it will take for you to be assisted!

 

Thank you for being an active member of the Flow Community!

 

-Gabriel
Flow Community Manager

-Gabriel
Microsoft Power Automate Community Manager
Are YOU a member of your local Power Automate User Group?
Fill out This Form to claim your Community User Group Member Badge!
Highlighted
Frequent Visitor

Re: Syncing Data on 2 Sharepoint Lists - Flow Is Caught in Loop and Keeps Creating the Same Record

Thank you so much for providing that solution for me! I can confirm that this did work on one of my flows and it did prevent duplicate entries on one list. But when I tested the other list, the flow didnt seem to catch that fact that is was creating a duplicate.

 

I mirrored your flow and created it twice:

 

Flow 1) one for items created on List A, then copied to List B

Flow 2) one for items created on List B, then copied to List A

 

As stated above, the solution worked for Flow 1, nothing duplicated when I entered in test data. However, its still duplicated items when tried Flow 2 which is set up identically.

 

I set up a condition to check if the title and date already exist on a item in the list before creating the new entry. The flows seems to running through that check, matching the items already on the list with the newly created item. However, It fails to identify that the new item has the same title and date as a item already on the list, so it proceed to create the item anyway.

 

This is the condition that I am using to determine if the item is a duplicate or not.

 

 

@and(equals(triggerBody()?['StartDate'], items('Apply_to_each')?['EventDate']), equals(items('Apply_to_each')?['Title'], triggerBody()?['Title']) )

 

 

Here is my flow that is failing to detect the duplicate item.Flow2.jpg

 

 

 

 

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (4,317)