cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CarlHRVA
Continued Contributor
Continued Contributor

Updating items in bulk

I'm trying to follow some steps in a blog to create an app where the users can update items in bulk. First they filter a gallery based on a dropdown for customer name/vendor. Then there is another dropdown with a list of collectors that they can choose from. I would like them to be able to select one person from the list of collectors and update the Collectors column in all of the filtered results to match the collector they have chosen. This is where I get a little lost. Do I need to create a collection based on this data, or is the data source sufficient? When I create an "Import Data" control and try to select the Excel workbook I receive the error "There was a problem importing your data. Make sure the file you are using is a PowerApps file." Any and all help would be greatly appreciated.

 

Thanks,

Carl

1 ACCEPTED SOLUTION

Accepted Solutions
FoDelement
Continued Contributor
Continued Contributor

You need to patch the data to sharepoint.

 

 

ForAll(Gallery1.AllItems, Patch('Collections DB', {ID: ID},{Collector: Dropdown5.Selected.Text}))

 

  • This assumes the Gallery is called Gallery1
  • The Sharepoint list is called 'Collections DB' and is added to the powerapp.
  • The Column in sharepoint is called Collector (This is case sensative) 
  • DropDown 5 is the dropdown value you want to set the Collector column to.

View solution in original post

16 REPLIES 16
FoDelement
Continued Contributor
Continued Contributor

Where is the data coming from?

Dropdown1 Has the collectors


Dropdown2 Has what? (I will call it objects, just for now)

 

Does the orginal data look like this..

 

Collector_Name    Collector_Object

Bob Dole                 Coins

If so, you can easily do this using the "Depends on" property of DropDown2

CarlHRVA
Continued Contributor
Continued Contributor

They both get their values from two different columns in the same data source. The requirement isn't to set up a cascading/dependent dropdown but rather to select from the list of available collectors and then use that value to update all of the items we filtered in the gallery using dropdown 1. 

 

This blog is exactly what I am trying to recreate but only using one dropdown field to filter the results of the gallery(for now)

https://powerusers.microsoft.com/t5/PowerApps-Community-Blog/Bulk-updates-for-a-filtered-gallery/ba-...

 

I've created the filter on the gallery based on the values returned in dropdown1 but now I'm lost as to how to update those filtered items using the submit button. Thanks for your help.

 

CarlHRVA
Continued Contributor
Continued Contributor

To answer your question: 

 

Dropdown 1                 Dropdown 2

Customer Name           Collector

 

I want to filter the results in the gallery based on what is selected in drop down one and then use the selected collector in dropdwon 2 to assign the same collector to all of the filtered results in the gallery. Does that make sense?

 

Thanks,

Carl

FoDelement
Continued Contributor
Continued Contributor

Sure. 

 

You want to filter the gallery like this.

 

On the ITEMS property of the gallery put this formula.

 

Filter(Repairs, Accessories = Dropdown3_1.Selected.Value)

 

In this case, Repairs is the Data source, Dropdown3_1 is the dropdown you want to use as the filter. 

 

Then for the label (or what ever is storing the Collector) in the gallery card, but this formula.

 

Dropdown2.Selected.Value

 

Dropdown2 being your collector.

 

https://snipboard.io/Z1sQGO.jpg

CarlHRVA
Continued Contributor
Continued Contributor

Thank you for responding. I've gotten that far but what I'm asking about is the next step to update the list in bulk.

 

Capture.PNG

 

This is my screen. I have the filter based on the Customer/Vendor Name in place for the gallery. From there I want to be able to select a name from the dropdown for Collector, check the checkbox and then click submit and have it update the Collector column with that collectors name for those items in the gallery.

 

 

CarlHRVA
Continued Contributor
Continued Contributor

This is the formula I currently have in place.

 

If(Checkbox1.Value=true,UpdateIf('Collections DB', "Customer Name"=Dropdown1.Selected.Result, {Collector: Dropdown4.Selected.Result}))

 

It doesn't return any errors but also nothing gets updated when I press the button.

FoDelement
Continued Contributor
Continued Contributor

Gotcha!


Okay, so what is the data source? 

 

Is it a SharePoint list, excel file? Etc.. 

CarlHRVA
Continued Contributor
Continued Contributor

It's a SharePoint list. Thank you!

FoDelement
Continued Contributor
Continued Contributor

You need to patch the data to sharepoint.

 

 

ForAll(Gallery1.AllItems, Patch('Collections DB', {ID: ID},{Collector: Dropdown5.Selected.Text}))

 

  • This assumes the Gallery is called Gallery1
  • The Sharepoint list is called 'Collections DB' and is added to the powerapp.
  • The Column in sharepoint is called Collector (This is case sensative) 
  • DropDown 5 is the dropdown value you want to set the Collector column to.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,007)