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 Values Button in...
Power Apps
Unanswered

Reset Values Button in TextInput

(0) ShareShare
ReportReport
Posted on by 12

Hi everyone!

 

I'm trying to add a "Reset Values" button to reset the values in TextInput item. My TextInput item has the formula ThisItem.Value and I want to change -0.07 by -0.1, for example, and after click Reset Values button, it changes by -0.07 (predeterminated value).

 

Is it possible?

 

Thank you very much.

Captura.PNG
Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hey @jha95 

     

     
    Can you share more details about the implementation, do you want to reset to old value when user changes it or do you want to round it off?
     
    If you want to reset the control, then you can add below code to the button and the text input control:
     
    Button -> OnSelect -> Set(ResetControl,true);Set(ResetControl,false)
     
    TextInput -> Reset -> ResetControl
     
    Please share more details so that we might help you better.
     
    Hope this helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
  • jha95 Profile Picture
    12 on at

    Thank you for your fast answer!

    I'm reading parameters values from an Excel file, for example, -0.07. I can change this value and save it in the Excel but I want to click in the "Reset Value" button and set the predeterminated values as -0.07. By the moment I created another sheet in Excel which has the predeterminates values of the parameters I want to set.

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hey @jha95 

     

    Did you try out with the expressions I suggested in my last reply? 
     
    This will reset the control to its default value. The value, that is passed in the Default property of the control.
     
    Button -> OnSelect -> Set(ResetControl,true);Set(ResetControl,false)
     
    TextInput -> Reset -> ResetControl
     
    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
  • jha95 Profile Picture
    12 on at

    It works perfectly!

    But I have a problem... If I change the value, save and execute my App -> OnStart, the "predeterminated" value is the changed one and I want to set back the predeterminated value -0.07 that I have in another sheet ("Predeterminated values Sheet").

    I did this:

    1. Open the App -> It execute OnStart -> Load the Excel data
    2. Change the predeterminated value: -0.07 by -0.09
    3. Save it
    4. Click in Reset Values button -> Change -0.09 by -0.07

    This part is OK.

    But I want to do this:

    1. Open the App -> It execute OnStart -> Load the Excel data
    2. Change the predeterminated value: -0.07 by -0.09
    3. Save it
    4. Close App
    5. Two hours later, for example, Open the App -> It execute OnStart -> Load the Excel data
    6. Now the predeterminated value is -0.09 and if I execute the Reset values button it doesn't change this to -0.07

    I'm trying to find the way to put back -0.07.

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hey @jha95 

     

    To achieve this, change the config as:
     
    Reset Button -> Set(Showpredeterminated,true)
     
    TextInput -> Default -> If(Showpredeterminated,Lookup('Predeterminated values Sheet',ColName = "Value1").Col2, Exising Expression to get last saved value)
     
    Here, Col2 is the name of column which holds predetermined value and ColName and Value1 is used to identify the record in Predeterminated values Sheet.
     
    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
  • jha95 Profile Picture
    12 on at

    My data origin is given by a flow, so I can't write 'Predeterminated Values Sheet' in the lookup sentence...

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @jha95 

     

    To get data from the sheet, you need to add a connection. Can you please share more details about the logical flow here? Maybe through some screenshots and example. The thing here is if this -0.7 is a fixed value, you can set this directly in the default property, otherwise either you need to connect to this other list or return this key from the flow you mentioned in above reply. If you could share more details, we might help you better.
     
    Hope this Helps!
     
    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
  • jha95 Profile Picture
    12 on at

    First of all, I have an Excel hosted in One Drive with two sheets: "Parameters Sheet" and "Calculated Sheet".1.PNG

    In my App -> OnStart, I'm reading the parameters of the "Parameters Sheet" with Flow and show it in a Gallery Item.2.PNG

    In the TextInput item, I change the value by -0.09 and save it.3.PNG

    Then, the cell is changed in the Excel file:4.PNG

    Now I want to change -0.09 who is in the TextInput item by the -0.07 value who is in the column "ValorFijo" (predeterminated value) with the "Reset" button.5.PNG

     

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @jha95 ,

    The process that you described is not "Reset" actually.

    In excel and PowerApps it will not save the original data.

    So if you want to come back to the original data, you could only update again.

    Try to set the reset button's OnSelect:

    Patch(tablename,ThisItem,{Valor parametro:ThisItem.ValorFijo})

     

    Best regadrs,

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard