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

Sync data between 2 Sharepoint lists - Inifinite loop

Hello,

 

I currently have 2 simple SharePoint lists,

 

List A: Users can create and modify their records at any time.

List B: Data replicated from ListA, used by admin to review and approve requests. 

 

For example lets say I have 2 columns on each of these lists. One name (text field) and another called Flow (yes or no).

 

I currently have 2 microsoft flows for each of my lists wihch are setup identical:

1) On item create or modify

2) Check to see if my Flow column is set to yes or no

   - If yes, then update item to reset value to no (Inifinte loop here)

   - If no, then Get item for 2nd list (filtered data)

       A) Is there no match from the Get item filter, yes or no? 

( equals(length(body('Get_items_2')?['value']), 0) )

            - If yes, then create new item on 2nd list. (inifinite loop here)

                a) I force the Flow column to Yes here.

            !- If no, then update item from 2nd list. (inifinite loop here)

                a) I force the Flow column to Yes here.

 

I really need these 2 lists to be synced up at all times, for example of something iscreated or modified on list B, it should reflect on list A. If something is updated or created on list A, it should reflect on list B.

 

Any insight on how to stop the inifinite loop?

1 REPLY 1
v-lin-msft
Level 10

Re: Sync data between 2 Sharepoint lists - Inifinite loop

Hi @Owizardo,

 

According to your requirement description of Flow, I created a Flow to achieve what you need is that 2 lists to be synced up at all times, the screenshot as below:

Annotation 2019-05-08 163826.png

 

When an item is created in list1, first judge whether the file added or modified exists in list2.

-If No, create item in list2.

-If Yes, judge whether it is a modified state:

If 'flow' is 'Yes', do nothing;

If 'flow' is 'No', update item in list 2.

You can create the other flow from this flow, but swap the elements in list 1 with list2.

 

And every time you change an item in the list, you have to set 'flow' state as 'No'.

 

If you still have the problem, please show us screenshots so we can help you find the source of the problem.

 

Best Regards,

Community Support Team _ Lin Tu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
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!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

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 Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (3,755)