web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Button to set all valu...
Power Apps
Answered

Button to set all values in a form to null/blank.

(0) ShareShare
ReportReport
Posted on by 34

Hello,

 

I have a form as shown below (on the right):

and49_1-1660121404720.png

 

I'm trying to use the "add new question" button to reset the values in the form to blank. However, "ResetForm" does not do this. I'm very new to powerapps. Does anyone have a solution?

 

Thanks.

Categories:
I have the same question (0)
  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    NewForm or ResetForm ?

    Do they work?

     

    https://docs.microsoft.com/en-us/power-platform/power-fx/reference/function-form

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,

    Gonçalo Nogueira

    Check my LinkedIn!

    Buy me a coffee!

    Check my User Group (pt-PT)!

    Last Post on Community

    My website!

  • and49 Profile Picture
    34 on at

    Have tried both, the formula bar is in the screenshot maybe i've done them wrong? The form is definitely called "Form1". I'm not sure why this wouldn't work. Thanks for your reply!

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    This shouldn't be the best option but you can always try reseting the inputs 1 by 1

  • and49 Profile Picture
    34 on at

    What function would i use for that?

    For example, for the 'Audit Name' the field is called "DataCardValue3". What would the code look like to reset that? If your solution works then I'm happy to accept as solution as i'll do the same for all of them.

     

    Thank you so much for your help either way. 

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    Reset(DataCardValue3.Text)

  • and49 Profile Picture
    34 on at

    This hasn't worked. Error states it's expecting a control value instead of text?

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    Reset(DataCardValue3), sorry my mistake

  • and49 Profile Picture
    34 on at

    Have tried this before unfortunately.

    "The reset function can only be used with resettable controls" is the error i'm getting from that code. 

     

    I can't see why this wouldn't work. 

  • VJR Profile Picture
    7,635 on at

    Okay just to respond to "why" it could be happening...

    As per the screenshot it looks like the Item property of the Form on the RHS could be Gallery1.selected.

    At all times at least one item in the Gallery (LHS) is selected and therefore it is always showing up in the Form on the RHS. Meaning - They are tied to each other. 

     

    You can verify this by adding the below line in the Gallery's TemplateFill property.

    If(ThisItem.IsSelected,LightGray,White)

    This is just to show how an item in the Gallery is always selected.

     

    Probably this would give you a direction on "how" to fix this part.

  • BCBuizer Profile Picture
    22,654 Super User 2026 Season 1 on at

    HI @and49 ,

     

    Changing the FormMode to FormMode.New, by using the NewForm() function, should clear all the fields, as the form will no longer use the Item property to look up values for an item to edit. Instead, it will use the Default property of the DataCards and/or the Default/DefaultSelectedItems/DefaultDate properties of the DataCardValue controls, depending on the type of control, to set any values. 

     

    Do you have any of the abovementioned Default properties set that may populate the form?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard