cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
egarcia_c
New Member

How to Update a specific record of a DataTable stored in a variable

I fetch the data from my Database and stored as Data Tables into a variable using

 

Set(MyTable, DataTableFetched).

Then, I need to trigger an update of this table each time a record is modified in a gallery component. I mean. When the user click a button associated to a specific record, I need to update a property for this specific record in the Variable mentioned before. 

Can someone help me with this issue? 

1 REPLY 1
RandyHayes
Super User
Super User

@egarcia_c 

You can store an entire table in a variable, but you do not get the ability to add/remove/edit records in it.  For that you would use a collection to store the table.

 

You can reinitialize your variable with each change to get close to what you want, but using a collection in this case would be beneficial over the variable.

i.e.  Set(MyTable, UpdateIf(MyTable, someCriteria, {some:Change}))

Whereas with a collection, it would be:

UpdateIf(MyTable, someCriteria, {some:Change}) only.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (2,508)