cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Waheedmohd1989
Microsoft
Microsoft

Reset a form from a Component Gallery button action

Need help or suggestion

 

I have created a component with a gallery and button in it to toggle between different field visibility based on a field type, need to reset the form when ever user click on a button with different types, the form needs to be reset as different field types capture specific info only, data entered previously needs to be cleared if the user change his/her mind on the field type.

 

So I need to pass the form name to the component as the input property to clear the data on the button click using 'ResetForm' function. Unfortunately there is no form type datatype in the component properties. 

 

Is there any other solution where I can reset the form on app screen based on the component button click.

 

I share the image of my component for reference.

Waheedmohd1989_0-1615653401834.png

 

Please help!!

 

Thanks In advance

 

1 ACCEPTED SOLUTION

Accepted Solutions

Yeah, it's resetting the form values. In the button click within the component the syntax is Component1.ResetOnSelect(). ResetOnSelect is a BhevaiorProperty of type Text.
Once the component is Added on the app, you can see ResetOnSelect property, and within that property i have added ResetForm(Form1).

Bilakanti_0-1615727145432.png

 

View solution in original post

4 REPLIES 4
Bilakanti
Responsive Resident
Responsive Resident

@Waheedmohd1989 ,

I have tried with one button within a component and using Property Type as Behavior. It worked for me.

Below is the screenshot for the same.

Bilakanti_0-1615722429722.png

 

Bilakanti_1-1615722461310.png

 

I have tried with behavior type property but as there is no datatype of form, it doesn't work.

 

Is the button click clearing the pre entered form values, if so what value did you give  in the 'onSelect' property of the button to perform the action. 

Seems like you missed that screen shot. Can you please share me if you are missing anything.

 

Thanks for the help.

 

Yeah, it's resetting the form values. In the button click within the component the syntax is Component1.ResetOnSelect(). ResetOnSelect is a BhevaiorProperty of type Text.
Once the component is Added on the app, you can see ResetOnSelect property, and within that property i have added ResetForm(Form1).

Bilakanti_0-1615727145432.png

 

Thank you, It worked 😁

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,941)