cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

update a field for each item in a browse gallery

I have a browse gallery that gets updated from a collection that is built earlier in the app.

 

What i want to do now is loop through all items in the browse gallery, and update a field in each item for these items only in this browse gallery. The problem is, it updates ALL items in the list the app is built off, and not just the items in the browse gallery.

 

Here is my current code, I do not understand why ALL items in the list get updated, and not just the items in the browse gallery!!

 

ForAll(BrowseGallery1_3.AllItems, UpdateIf(Inventory, BrowseGallery1_3.Selected.Tracking_ID in Inventory.Tracking_ID, {Equipment_Status:"CHECKED OUT", Renter_x0020_Name:TextInput2.Text}))

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Advocate II
Advocate II

Re: update a field for each item in a browse gallery

Hey thanks for the post, i just figured it out though!!!

 

Here is my code: Where selectedItems is my collection built earlier in the app, Inventory is the sharepoint list, and Tracking_ID and Renter_x0020_Name are the fields i wanted to update!!!! So happy i solved that!

 

ForAll(SelectedItems, UpdateIf(Inventory, Tracking_ID in SelectedItems.Tracking_ID,{Equipment_Status:"CHECKED OUT", Renter_x0020_Name:TextInput2.Text})); SendPinNumberToUser.Run(User().Email, TextInput3.Text); Refresh(Inventory)

View solution in original post

3 REPLIES 3
Highlighted
Helper I
Helper I

Re: update a field for each item in a browse gallery

@Bri

 

Could you use the Filter() formula to filter down the records to only those that you want/need to update? Then do a refresh of the datasource so that you display the latest information in your gallery?


Something like this in your update formula: 

 

Filter(Inventory, BrowseGalelry1_3.Tracking_ID in Inventory.Tracking_ID)

 

And then refresh the data source like this:

 

Refresh(Inventory)

 

Could that work?

 

Tudor

Highlighted
Advocate II
Advocate II

Re: update a field for each item in a browse gallery

Hey thanks for the post, i just figured it out though!!!

 

Here is my code: Where selectedItems is my collection built earlier in the app, Inventory is the sharepoint list, and Tracking_ID and Renter_x0020_Name are the fields i wanted to update!!!! So happy i solved that!

 

ForAll(SelectedItems, UpdateIf(Inventory, Tracking_ID in SelectedItems.Tracking_ID,{Equipment_Status:"CHECKED OUT", Renter_x0020_Name:TextInput2.Text})); SendPinNumberToUser.Run(User().Email, TextInput3.Text); Refresh(Inventory)

View solution in original post

Highlighted
New Member

Re: update a field for each item in a browse gallery

Hello from 2018!

I have been pulling my hair out trying to work this out, and thanks to your post I can now glue my hair back on!

I was trying to achieve something very similar to you, but logic thinking (and only starting to use PowerApps 2 days ago) wasn't working.

 

Thank you!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,724)