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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Trying to reset a Text...
Power Apps
Unanswered

Trying to reset a TextInput to Default Value that has a variable as the default value

(1) ShareShare
ReportReport
Posted on by 9

I am creating a check-in/check-out really simple PowerApp. I have a check-in button that reads current time to a TextInput box and then sends that information to a SharePoint list.

 

The problem I'm having is that when I am then going back to the home-screen, the TextInput boxes still have data in them, which would be confusing in the SharePoint list.

 

I have tried Reset(TextInput) - the problem is that the variable VarTimeNow is the default field for this TextInput box. So every time you reset it, it stays as is, which is frustrating! Does anyone know of a way to clear a TextInput box at a click of a button i.e. the submit button once a person is finished? 

 

I can see a clear toggle which introduces an 'X' icon in the text field, but telling people to clear a box before they hit submit will probably happen 50% of the time... Any help would be hugely appreciated thanks! 

Categories:
I have the same question (0)
  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @RyanCoram,

     

    Is it a possibility to reset the variable after submitting the data?

    //Should it be a local var
    UpdateContext({VarTimeNow: Blank()})
    
    //Should it be a global variable
    Set(VarTimeName, Blank())

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • RyanCoram Profile Picture
    9 on at

    Unfortunately that over-rides the data completely and doesn't show the time for the short amount of time that it needs to appear.

     

    I am looking to have the data appear like this: 

     

    RyanCoram_0-1689092504299.png

     

    And then upon clicking submit, for the field to be empty or replaced with a string. So that when the next person comes to use it, that data is cleared. 

     

    This is what I have in my submit button as it stands: 

    RyanCoram_1-1689092592694.png

     

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    @RyanCoram,

     

    I don't fully follow why would it override the data if the user has already submitted the data? After the Navigate function you could reset that variable which removes the date within your TextInput.

     

    Alternatively - Should you not want to clear VarTimeNow, you could create a variable to track whether the data was submitted and only show the Default textinput when this variable is set to false e.g. varSubmitted 

    //After submitting (after the nav function)
    Set(varSubmitted, true)
    
    //In the Default property of your TextInput (only show time if it is false):
    If(!varSubmitted, VarTimeNow)
    
    //When a new user wants to see the date (e.g. when navigating to the submission screen)
    Set(varSubmitted, false)

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • RyanCoram Profile Picture
    9 on at

    That worked! Thank you 🙂 

  • CU24070609-0 Profile Picture
    on at
    @RyanCoram,
    @LaurensM
     
    It's showing the error when I use the code:
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard