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
Solved! Go to Solution.
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.
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.
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.
Awesome! Happy it worked for you!
User | Count |
---|---|
148 | |
94 | |
85 | |
78 | |
57 |
User | Count |
---|---|
193 | |
175 | |
104 | |
95 | |
91 |