cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
james_riach
Advocate IV
Advocate IV

How to update list 2 when list 1 has been modified where items in list 1 and 2 have different IDs

Hi all,

 

I have two lists in SPO. List 1 and List 2. I want a flow to create the same item that has been created in List 1 to List 2 which is easy enough. However I also want to have flow update the item created in List 2 with any changes that are made to that item in List 1.

 

Where I am struggling is the IDs of the items are not the same in the two lists as in List 2 more records will be added outside of flow meaning the IDs will be out of sync between the lists.

 

I have set up a column in List 2 called 'List1ID' which updates the ID no. of that item from List 1 here in a number format so it can be reference however I cannot seem to get flow to work. I am basically looking to make a condition of some kind that says does ID in List 1 equal ListID1 in List 2, if yes then update that item in List 2 and if no then create that item in List 2.

 

It sounds so simple but after trying so many approaches I just cannot get this to work.

 

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions

Let's choose "Filter array" approach: you just need to add the output of the "Get items" as input for the Filter Array ("From" field)

Then you need to define the proper condition by selecting both the target column from List#2 and the desired ID value.

Hope this helps

Filter array



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

3 REPLIES 3
efialttes
Super User III
Super User III

Hi @james_riach

I guess you are applying "Get items" action block on List#2; and you need to filter the results under List1ID eq 'x' with X being the ID from List#1, right?

You can try two different approaches: the first one is to apply an ODATA filter on "Get items" action block under Advanced options; the second one is to apply a subsequent "Filter array" action block.

Hope this helps

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Hello @efialttes

 

Thank you for your response.

 

You are correct. I am applying a "Get items" action block on List 2.

 

I have tried doing both the "Filter Query" under the "Get Items" action block and the "Filter Array" action but I cannot get neither to work.

 

Would you be able to provide me with an example of how to get this working please?

 

Thank you

Let's choose "Filter array" approach: you just need to add the output of the "Get items" as input for the Filter Array ("From" field)

Then you need to define the proper condition by selecting both the target column from List#2 and the desired ID value.

Hope this helps

Filter array



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

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

Users online (17,630)