cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate III
Advocate III

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
Highlighted
Dual Super User III
Dual Super User III

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

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
Highlighted
Dual Super User III
Dual Super User III

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

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!



Highlighted
Advocate III
Advocate III

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

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

Highlighted
Dual Super User III
Dual Super User III

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

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (7,828)