cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Resolver IV
Resolver IV

Re: how to clear various inputs controls in a gallery record Onselect

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
Highlighted
Resolver IV
Resolver IV

Re: how to clear various inputs controls in a gallery record Onselect

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

 

Highlighted
Post Patron
Post Patron

Re: how to clear various inputs controls in a gallery record Onselect

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

Highlighted
Resolver IV
Resolver IV

Re: how to clear various inputs controls in a gallery record Onselect

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

Highlighted
Post Patron
Post Patron

Re: how to clear various inputs controls in a gallery record Onselect

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!

Highlighted
Resolver IV
Resolver IV

Re: how to clear various inputs controls in a gallery record Onselect

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

Highlighted
Post Patron
Post Patron

Re: how to clear various inputs controls in a gallery record Onselect

hello @pontusofsweden 

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

Thanks for your help and clear explanations.

Highlighted
Resolver IV
Resolver IV

Re: how to clear various inputs controls in a gallery record Onselect

Hi!

Glad to help 🙂

BR

Pontus

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

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 (9,416)