cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PDiracDelta
Frequent Visitor

Set value of TextBox (in gallery) on button click

I have a Gallery with Items.
Each Item has a Textbox associated with it.
Users can modify the values in the Textbox and submit them.

After they click submit, I wish to (re)set the values in the Textbox to some default value x.

 

How can I do that? What is the command to set 'Textbox.Value' to 'x'?

1 ACCEPTED SOLUTION

Accepted Solutions
PDiracDelta
Frequent Visitor

I have found a workaround (for default value x and Gallery definition GALLERY_DEFINITION😞

  1. On the App screen, do: OnStart=Set(ValueResetter, false);
  2. On the Submit button, do: OnSelect=Set(ValueResetter, true); Set(ValueResetter, false);
  3. On the Gallery, do: Items=If(Not ValueResetter, GALLERY_DEFINITION)
  4. On the TextBox, do: Value=If(ValueResetter, x, x)

View solution in original post

3 REPLIES 3
StalinPonnusamy
Community Champion
Community Champion

Hi @PDiracDelta 

 

Set the Default Property of TextBox to Blank() or ""

 

Thanks for responding. Two issues here:

1. I wish to set the property automatically by clicking on a button, not by actually setting a value in the interface.

2. TextBox has no Default property, only a Placeholder property. From what I learned, the Reset function exists but it only applies to objects with a Default property.

PDiracDelta
Frequent Visitor

I have found a workaround (for default value x and Gallery definition GALLERY_DEFINITION😞

  1. On the App screen, do: OnStart=Set(ValueResetter, false);
  2. On the Submit button, do: OnSelect=Set(ValueResetter, true); Set(ValueResetter, false);
  3. On the Gallery, do: Items=If(Not ValueResetter, GALLERY_DEFINITION)
  4. On the TextBox, do: Value=If(ValueResetter, x, x)

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,754)