cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
eb11818
Level: Powered On

Patching Multiple Records in Canvas App

I'd really appreciate help with this issue.  I'm ultimately just trying to change values in multiple records in a Canvas app - pretty basic.  

 

Here is context on the tables, etc.  TimeLog is the table to update.  My understanding was I needed to filter another table for this method, so I created Replica as a copy of the ID field of the TimeLog table - renaming ID as ID_Rep in Replica.  txtID.Text has the ID value of the current record on the screen, and txtRollForward has the number of records after to update the values.

 

Here's the code I tried.  I believe there may be an issue with disambiguation.

 

ForAll(Filter(Filter(Replica,ID_Rep>=Value(txtID.Text)),ID_Rep<=(Value(txtID.Text)+Value(txtRollForward.Text)),Patch(TimeLog,LookUp(TimeLog, TimeLog[@ID]=Replica[@ID_Rep],{Assignment:drpAssignment.Selected.Assignments})

 

1 ACCEPTED SOLUTION

Accepted Solutions
cwebb365
Level 10

Re: Patching Multiple Records in Canvas App

Basically if delegation isn't an issue thou. I think you can get by with a simple UpdateIf() command. 

 

So if your dataset or local collection is named records, you would hav esometing like UpdateIf(records, columnwithID > x && columnwithID < y, { Columntoupdate: Textbox1.Text}) assuming all the values would get getting that value. I might not be understanding you correctly thou on what you want to update. 

 

If that's not right, do you have a collection you update that you need to write those changes back to a sheet?  

9 REPLIES 9
cwebb365
Level 10

Re: Patching Multiple Records in Canvas App

Shouldn’t have to be that convoluted to update records Smiley Wink. Can you explain a bit more about the data source in use? Are you storing the changes to a collection then updating that changes or making the patch changes on the same screen you update the individual item etc?
eb11818
Level: Powered On

Re: Patching Multiple Records in Canvas App

I'd love it if it is simpler than the path I was going.

 

It's a canvas app, so it just has a spreadsheet with a table that has a series of records.  I want to push a button & have PowerApps update a field for every record in a range from one ID# to a certain # of ID's afterwards.  

 

I don't know anything about Collections.  I'm one of those who was really looking forward to this being "No Code" and intuitive, but I can always read more if necessary.

eb11818
Level: Powered On

Re: Patching Multiple Records in Canvas App

@cwebb365 

 

Sorry to bug you, but I would sooooo appreciate it if you had an answer to share........

 

Thanks so much!

eb11818
Level: Powered On

Re: Patching Multiple Records in Canvas App

This is pretty basic processing, no?  I mean it would be super easy to write in a query.  Surely, there's an easy answer that just hasn't been shared?  Otherwise, PowerApps is pretty limited.  Thanks!

cwebb365
Level 10

Re: Patching Multiple Records in Canvas App

ok sorry been super busy. is the range definable by a filter? So I want to update records between ID 100 and 150 with x column = y?
eb11818
Level: Powered On

Re: Patching Multiple Records in Canvas App

@cwebb365 

 

Of course - I didn't mean my follow-up post to be for you.  I just consider this pretty basic processing, so I was expecting any slightly experienced PowerApps developer could swoop in & answer it.  Hope it isn't considered advanced processing?

 

How you wrote it is pretty much right.  Only difference (that shouldn't make a difference) is that the numbers are calculations involving text box values.  Also, the value to update the field comes from a text box.

 

Thanks so much!!!

cwebb365
Level 10

Re: Patching Multiple Records in Canvas App

Your biggest issue is going to be delegation. This is an excel spreadsheet? How many records are in this, because the max you'll be able to work with is 2000 total on a sheet. Here is more information. Want to make sure we understand that before we get into trying to figure out the updates Smiley Happy.

http://powerappsguide.com/blog/post/how-well-does-powerapps-cope-with-large-excel-files
cwebb365
Level 10

Re: Patching Multiple Records in Canvas App

 
cwebb365
Level 10

Re: Patching Multiple Records in Canvas App

Basically if delegation isn't an issue thou. I think you can get by with a simple UpdateIf() command. 

 

So if your dataset or local collection is named records, you would hav esometing like UpdateIf(records, columnwithID > x && columnwithID < y, { Columntoupdate: Textbox1.Text}) assuming all the values would get getting that value. I might not be understanding you correctly thou on what you want to update. 

 

If that's not right, do you have a collection you update that you need to write those changes back to a sheet?  

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 198 members 4,726 guests
Please welcome our newest community members: