cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

Patch Collection Array to Excel database

I am trying to patch multiple Rows of Table data. I was able to do one at a time using this:
 
Slider
OnChange

 

Patch(TaskTable,LookUp(TaskTable,'Job Task'=ThisItem.'Job Task'&&'Job Name'=Dropdown1.Selected.'Job Name'),{'Job Task compleation Percentage':Slider1.Value})

 

But now because I added the ability to reset all the slider to before changes to sider were made I don't think I can save each one as there changed anymore and have looked into packing more than one data rows at a time all at once but I'm not sure how to do that. I'm thinking about setting it up to save all the data before changes are made when the job is selected and set all the values back when the reset button is pressed but I still need to set multiple values with patch.
This is as far as I got.

 

Power App Progress:

SysDev.png

 

TaskTable (Raw Data)

TableData.png

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Patch Collection Array to Excel database

Hi @natmaxex ,

 

Try to use ForAll function to patch multiple items. Modify the SubmitButton.OnSelect:

ForAll(RenameColumns(SliderBarGallery.AllItems, "Job Task", "JT"),
Patch(TaskTable, LookUp(TaskTable,'Job Task'=JT &&'Job Name'=Dropdown1.Selected.'Job Name'), {'Job Task compleation Percentage':JobTaskPercentSlider.Value}))

Hope this helps.

Sik

View solution in original post

Highlighted
Resolver I
Resolver I

Re: Patch Collection Array to Excel database

Solved it!

ForAll(AddColumns(SliderBarGallery.AllItems,"JobLable",JobTaskLable,"JobSlider",JobTaskPercentSlider), Patch(TaskTable,LookUp(TaskTable,'Job Name'=JobNameDroppdown.Selected.'Job Name' && 'Job Task'=JobTaskLable.Text),{'Job Task Compleation Percentage':JobTaskPercentSlider.Value}))

doesn't matter wat you call the columns as long as they update at the same time.

View solution in original post

5 REPLIES 5
Highlighted
Community Support
Community Support

Re: Patch Collection Array to Excel database

Hi @natmaxex ,

 

Try to use ForAll function to patch multiple items. Modify the SubmitButton.OnSelect:

ForAll(RenameColumns(SliderBarGallery.AllItems, "Job Task", "JT"),
Patch(TaskTable, LookUp(TaskTable,'Job Task'=JT &&'Job Name'=Dropdown1.Selected.'Job Name'), {'Job Task compleation Percentage':JobTaskPercentSlider.Value}))

Hope this helps.

Sik

View solution in original post

Highlighted
Resolver I
Resolver I

Re: Patch Collection Array to Excel database

I'm having trouble getting this to work, alsto what is "JT" I tried replaceing it with

 

"fence", {'Job Task':"fence", 'Job task':"Window","Wall"}, {"fence","Window","Wall"}, and [{"fence","Window","Wall"}].

 

I'm just not sure 'Job Task'' is the best value to use since there might be other jobs with similar 'Job Task' names, that's why I like to use 'Job ID'' in relation with 'Job Name''

Highlighted
Resolver I
Resolver I

Re: Patch Collection Array to Excel database

I almost got it working with this

 

ForAll(SliderBarGallery.AllItems.JobTaskPercentSlider, Patch(TaskTable,LookUp(TaskTable,'Job Name'="JobTestName_01" && 'Job Task'=JobTaskLable.Text), {'Job Task Compleation Percentage':JobTaskPercentSlider.Value}))

 

it goes through all the slider.Values but it doesn't place them in there appropriate columns it puts everything in the last column.

Highlighted
Resolver I
Resolver I

Re: Patch Collection Array to Excel database

This is so close I can almost taste it!

 

 

ForAll(SliderBarGallery.AllItems.JobTaskLable, Patch(TaskTable,LookUp(TaskTable,'Job Name'=JobNameDroppdown.Selected.'Job Name' && 'Job Task'=JobTaskLable.Text),{'Job Task Compleation Percentage':JobTaskPercentSlider.Value}))

 

 

ThankfulImmaterialApatosaur-size_restricted

If only I cold do something like this

 

ForAll(SliderBarGallery.AllItems.(JobTaskLable,JobTaskPercentSlider), Patch(TaskTable,LookUp(TaskTable,'Job Name'=JobNameDroppdown.Selected.'Job Name' && 'Job Task'=JobTaskLable.Text),{'Job Task Compleation Percentage':JobTaskPercentSlider.Value}))

 

Or

ForAll(And(SliderBarGallery.AllItems.JobTaskLable,SliderBarGallery.AllItems.JobTaskPercentSlider), Patch(TaskTable,LookUp(TaskTable,'Job Name'=JobNameDroppdown.Selected.'Job Name' && 'Job Task'=JobTaskLable.Text),{'Job Task Compleation Percentage':JobTaskPercentSlider.Value}))

Or

ForAll(SliderBarGallery.AllItems.JobTaskLable && SliderBarGallery.AllItems.JobTaskPercentSlider, Patch(TaskTable,LookUp(TaskTable,'Job Name'=JobNameDroppdown.Selected.'Job Name' && 'Job Task'=JobTaskLable.Text),{'Job Task Compleation Percentage':JobTaskPercentSlider.Value}))

I can Combine or stack ForAll's but its still not giving me the the results i'm looking for. 

ForAll(galleryItemA,ForAll(galleryItemB, {item:value}))
Highlighted
Resolver I
Resolver I

Re: Patch Collection Array to Excel database

Solved it!

ForAll(AddColumns(SliderBarGallery.AllItems,"JobLable",JobTaskLable,"JobSlider",JobTaskPercentSlider), Patch(TaskTable,LookUp(TaskTable,'Job Name'=JobNameDroppdown.Selected.'Job Name' && 'Job Task'=JobTaskLable.Text),{'Job Task Compleation Percentage':JobTaskPercentSlider.Value}))

doesn't matter wat you call the columns as long as they update at the same time.

View solution in original post

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,542)