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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,647)