cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Patron
Post Patron

how to clear various inputs controls in a gallery record Onselect

Hello

I have various input controls (combobox, text input and date picker) in a gallery, which already have default values.

How can users reset individual fields to clear some but not all data in a gallery record, using OnSelect button?``

Thanks in advance 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi!

The patch function update records, thats correct. "Erasing" data is also an update operation but with blank values. So it´s basically the same process as when you want to update a column with "real" data. With the formula provided earlier, you update the record with blank values.

 

BR

Pontus

View solution in original post

7 REPLIES 7
Resolver IV
Resolver IV

Hi @Englishweb!

 

You can use the Reset function within the gallery to set the controls to their default value. E.g. Reset(DatePicker2). Just add the specific controls to your OnSelect formula and those will be reset.

BR

Pontus

 

Hello @pontusofsweden 

Thank you for your reply. Unfortunately this doesn't work in my case because the default value IS the saved value.

So I need a way to clear certain cells from the datasource (Excel on OneDrive), but not the whole record (row).

Any suggestions?

Thanks

Hi!

 

Ok, so you want to clear the values from the datasource..then it´s more clear 🙂 The ordinary way is to use the Patch functionality within the gallery. Just change the name to your datasource and field names.

 

Patch(Datasource,ThisItem,{Field1:"",Field2:""}) etc...

 

BR

Pontus

Hello  @pontusofsweden 

I'm confused - I'm using Patch to save the data to a datasource and I would like to add a button that allows the user to delete the same data from the datasource when the task has been completed.

How can patch do this?

Sorry if I'm being really stupid here!

Hi!

The patch function update records, thats correct. "Erasing" data is also an update operation but with blank values. So it´s basically the same process as when you want to update a column with "real" data. With the formula provided earlier, you update the record with blank values.

 

BR

Pontus

View solution in original post

hello @pontusofsweden 

My fault! I misread the "" blank values. Your solution works perfectly! 

Thanks for your help and clear explanations.

Hi!

Glad to help 🙂

BR

Pontus

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (20,093)