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 / Reset Field Value to 0...
Power Apps
Answered

Reset Field Value to 0 On Change when Error

(0) ShareShare
ReportReport
Posted on by 95

I have two fields on my form that need to be reset to "0" if they exceede the value of the parent field. Currently, OnChange of the field will show an error if the value is greater than the parent value, however, it is not resetting the value back to "0". 

Here is my code for the OnChange of the field: 

If(
 Value(DataCardValue5.Text) > 0 && Value(DataCardValue71.Text) > Value(DataCardValue5.Text),
 SetFocus(DataCardValue71);
 Reset(DataCardValue71);
 Notify(
 "Child TCR cannot be greater than Parent TCR",
 Error
 )
);

 

As you can see, the field values remain greater than the parent values, but I want them to reset to 0. 

 

TSRTCR_ErrorNotResetting.png

 

Categories:
  • SebS Profile Picture
    4,882 Super User 2026 Season 2 on at

    This is cause You setting Focus on it first reset it than Set Focus

     

     

    If(
     Value(DataCardValue5.Text) > 0 && Value(DataCardValue71.Text) > Value(DataCardValue5.Text),
     Reset(DataCardValue71);
     SetFocus(DataCardValue71);
     Notify(
     "Child TCR cannot be greater than Parent TCR",
     Error
     )
    );

     

  • cjwilson80 Profile Picture
    95 on at

    @SebS  Thank you, I tried removing the SetFocus() and then moving it after the Reset(), but it's still not resetting the value to 0... 

  • SebS Profile Picture
    4,882 Super User 2026 Season 2 on at

    @cjwilson80 

     

    Did this Reset the control at all to blank() ? try just Reset() in button and check if it will reset this control

    also is this inside of the form by any chance and what You have in the Default property 

     

  • Verified answer
    SebS Profile Picture
    4,882 Super User 2026 Season 2 on at

    @cjwilson80 

     

    I think This is a form I'm right and You can't reset form like that. it have property called Default and Reset will reset it to Default.

     

    You need to Set up variable

     

     

    UpdateContext({Reset1:true})

     

     

    Now in the Default property of the control place 

     

     

    If(UpdateContext({Reset1:true}),0,Parent.Default)

     

     

    Also add to OnVisible property of the Screen 

     

     

    UpdateContext({Reset1:false})

     

     

    and just in case in the submit button 🙂 also I will add it to OnChange property of the Control You are resetting just in case someone make a mistake and again You need to Reset it back 🙂 I'm not sure what process you fallow there 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 224 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 126

Last 30 days Overall leaderboard