cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted

@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
Highlighted
Super User III
Super User III

@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."

Highlighted

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.

Highlighted

@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

Highlighted

@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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,739)