Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Set value of TextBox (in gallery) on button click

(0) ShareShare
ReportReport
Posted on by 13

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'?

  • Verified answer
    PDiracDelta Profile Picture
    PDiracDelta 13 on at
    Re: Set value of TextBox (in gallery) on button click

    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)
  • PDiracDelta Profile Picture
    PDiracDelta 13 on at
    Re: Set value of TextBox (in gallery) on button click

    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.

  • Re: Set value of TextBox (in gallery) on button click

    Hi @PDiracDelta 

     

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

     

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,636

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,942

Leaderboard