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
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.
See below example here I am trying to filter a column value called UPN equals 100 and updating the list item against the id.
If you have any questions please let me know.
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.
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
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.
Check out how to claim yours today!
Check out new user group experience and if you are a leader please create your group
Test your skills now with the Cloud Skill Challenge.