cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Owizardo
Helper III
Helper III

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
Post Prodigy
Post Prodigy

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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Users online (30,007)