cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Englishweb
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
pontusofsweden
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

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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (4,611)