Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Resetting value on text input field after submission not working \ Set variable to blank after form submission

(0) ShareShare
ReportReport
Posted on by 85

I have a text input field in my canvas form formatted as number. As the default value I'm using a variable named varPayInput. For the OnChange event of that field I'm using the following formula:

 

UpdateContext({varPayInput: Text(Value(DataCardValue7.Text), "$#,##0.00")})

 

This formats the field to currency after someone inputs an amount, and it works beautifully, however, when the record gets submitted the amount previously input doesn't go away. I'm assuming it has to do with the variable, but I'm not sure how to remove it. I've tried various how to's from Google to no avail.

  • Verified answer
    BCBuizer Profile Picture
    BCBuizer 21,809 on at
    Re: Resetting value on text input field after submission not working \ Set variable to blank after form submission

    HI @ShawnPelletier ,

     

    In the OnSuccess property of the form you need to set the variable to blank:

     

    UpdateContext({varPayInput:Blank()})

     

    By using the OnSuccess property you are certain the form is successfully submitted before resetting the variable.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,343

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard