cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
StuCundy
Post Patron
Post Patron

patch for all

I have patch sequence that works for the item but I cannot get the for all to work.

I have a collection with a column HostingStatus with I want to change to the value of a dropdown.  This works to change selected item.

 

Patch(HostSearch,LookUp(HostSearch,ID=ThisItem.ID), {HostingStatus: StatusDropDown_1.SelectedText})

 

In the collection I have added a column and a check box to patch multiple items.

 

ForAll(RenameColumns(Filter(
        ColHostListGallery.AllItems,AddToHostSearchCB.Value = true), "ID", "EID"), Patch(HostSearch, LookUp(HostSearch, ID=EID), {HostingStatus:Dropdown2.SelectedText}))

 

 Look forward to some suggestions, thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

@mdevaney 

I managed to get the for all patch working, there was an error in the code and it was reading another checkbox on another screen.  casualty of duplicating screens.  Thanks for your help though.

View solution in original post

4 REPLIES 4
mdevaney
Super User
Super User

@StuCundy 
You can use UPDATEIF to change the entire column all-at-once without a loop.  Its much faster than FORALL.

UpdateIf(
    RenameColumns(
        Filter(ColHostListGallery.AllItems,AddToHostSearchCB.Value = true),
        "ID", "EID"
    ),
    ID=EID,
    {HostingStatus:Dropdown2.SelectedText}
)


---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Hi @mdevaney 

My gallery is reading a collection from the SP list and my objective is to update a column in the SP list called HostSearch.  So I want to update the SP list and then I can ClearCollect the collection again.

@mdevaney 

I managed to get the for all patch working, there was an error in the code and it was reading another checkbox on another screen.  casualty of duplicating screens.  Thanks for your help though.

@StuCundy 
If your question is solved, please close the thread so others know its fixed.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (4,970)