cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Ardian
Level: Powered On

Updating multiple list items in powerapps

HI All, 

 

Wondering if anyone can help with following, i have a list which has a number of items in, i also have a choice field called Review with the following choices:

In Progress

Completed

Archive

 

how do i set all Completed items to Archive? i was playing around with the following:

ForAll(Filter('Quarterly Reviews', Review.Value = "Completed"), Patch('Quarterly Reviews', LookUp('Quarterly Reviews', ID = 'Quarterly Reviews'.ID), {Title:"1211111111"}))

 

i know i'm updating the title but if i could only identify items to update then i can easly change the column. 

 

Thanks in Advance

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Updating multiple list items in powerapps

Hey @Ardian, I think the issue may be that you are trying to loop through the same data source you are writing to, and PowerApps doesn't like that so much. Maybe try something like this:

 

// Collect the items to loop through
ClearCollect( colFilteredQuarterlyReviews, Filter('Quarterly Reviews', Review.Value = "Completed") );
// Perform the loop ForAll( colFilteredQuarterlyReviews, Patch( 'Quarterly Reviews', LookUp( 'Quarterly Reviews',
ID = colFilteredQuarterlyReviews[@ID] ), { Title:"1211111111" } ) )

Once you get the loop right, the rest is just setting the data you want to patch given the condition set in the previous collection. Let me know if I didn't get this right; I just did this off the cuff and may have messed up the syntax somewhere.  

3 REPLIES 3
Super User
Super User

Re: Updating multiple list items in powerapps

Hey @Ardian, I think the issue may be that you are trying to loop through the same data source you are writing to, and PowerApps doesn't like that so much. Maybe try something like this:

 

// Collect the items to loop through
ClearCollect( colFilteredQuarterlyReviews, Filter('Quarterly Reviews', Review.Value = "Completed") );
// Perform the loop ForAll( colFilteredQuarterlyReviews, Patch( 'Quarterly Reviews', LookUp( 'Quarterly Reviews',
ID = colFilteredQuarterlyReviews[@ID] ), { Title:"1211111111" } ) )

Once you get the loop right, the rest is just setting the data you want to patch given the condition set in the previous collection. Let me know if I didn't get this right; I just did this off the cuff and may have messed up the syntax somewhere.  

Ardian
Level: Powered On

Re: Updating multiple list items in powerapps

Hi @wyotim That worked perfectly, i had the following, which was also not working:

ClearCollect(ReviewsToPatch, Filter('Quarterly Reviews', Review.Value = "Current")); 
ForAll(ReviewsToPatch,Patch('Quarterly Reviews', LookUp('Quarterly Reviews', ID = ReviewsToPatch.ID), {Title:"1211111111"}))

I can see what you did with the collection ID which solved the issue. 

 

I changed wording but i did a test exactly as you sent it and syntax was all correct

 

Thank you for your help. 

Super User
Super User

Re: Updating multiple list items in powerapps

Awesome! Happy it worked for you!

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 53 members 4,643 guests
Please welcome our newest community members: