cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RomanKorchak
Helper IV
Helper IV

Copy some data from one sp list to another

Hi All

I am working on a scheduled flow that needs to take some data from one SP List and update another SP List.

So I need to Get Items from FromList and update MonthlyTotals where column 'OfficeId' matches.

So I Get Items from FromList and then do ApplyToEach on FromList.

And the question is - in ApplyToEach how do I get an ID of an item in MonthlyTotals that I need to update  

UpdateItem2.JPG

Thanks

6 REPLIES 6
abm
Super User III
Super User III

Hi @RomanKorchak 

 

To update the Monthly Totals list you need action step Get Items and set Filter Query. Using this results you should be able to get the ID of the related item you want to update.



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials
abm
Super User III
Super User III

Hi @RomanKorchak 

 

See below example here I am trying to filter a column value called UPN equals 100 and updating the list item against the id. 

 

image.png

 

If you have any questions please let me know.



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

So if I have a list with 1000 records I will need to do 1000 GetItem`s? 

Hi @RomanKorchak 

 

It depends the filter. If your filter query can get only one record per query and update then yes you need 1000 Get items to find each records id. If you have more than one record per filter then you can do it in a foreach loop to execute the update with different id's.

 

The main difference here is

 

Select id from employee where country = 'UK'

 

So in this instance you may have more than one records where people living in one country. This can return one or more records.

 

Select id from employee where country = 'UK' and email = 'test.com'

 

So in this instance you may have only one record you are expecting. To be able to get other employees id you need to execute another select with another email address.

 

Hope you understood what I am trying to explain here.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

Can I make an object value and then in ApplyToEach on MonthlyTotals (all, without filtering) add its ID as a property of the object (something like Object[OfficeId]=ID , OfficeId is unique)  so it can by used when updating values in ApplyToEach on FromList (do UpdateItem on MonthlyTotals with ID set to Object[OfficeId]). I just could not find how to add a property to the object.

Hope it make sense

Thanks

Hi @RomanKorchak 

 

Not sure you can. Still you need you internal id to update. This is like a primary key. Yes your office id may be unique but for each records the primary key is different. You can collect all the office id's in an array and iterate the array but still you need to get the id's (internal value) for the update. Hope it make sense.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Users online (1,950)