cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
josh99smith
Level: Powered On

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 Smiley Happy

 

FLOW #1
Flow1.jpg

 

FLOW #2

Flow2.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

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

4 REPLIES 4
Super User
Super User

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
Community Support Team
Community Support Team

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

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 Flow Community Manager
josh99smith
Level: Powered On

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

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 182 members 5,492 guests
Please welcome our newest community members: