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
Impactful Individual
Impactful Individual

@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 Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (6,188)