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 / stop textinput resetti...
Power Apps
Answered

stop textinput resetting in gallery when adding a new item to gallery

(0) ShareShare
ReportReport
Posted on by 270

hi all,

 

I have a gallery with a textinput box (not linked to the sharepoint table the gallery is linked to)

 

the text input is just there and patched into Sharepoint seperately

 

Every time I add a new item into the Gallery (create new record in sharepoint) it wipes anything from my textinput box and resets it back to it's default. as the idea is user is creating 5+ records in the gallery at a time then submitting after 5 records. but after every time a record is create it's clearing everything which is very frustrating to work around.

 

Is there any way around this?

 

 

 

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,545 Most Valuable Professional on at

    @mrleetyler ,

    This is a known behavior (bug?) with galleries on unbound controls.

    The workaround if your gallery is based on a collection is to use AddColumns when collecting and add a Text field. On your save code, also Patch the value of the Textbox to this field and make the Default of the Text Box ThisItem.YourTextFieldName. When the gallery resets, it will retain the value in the box. If you are working directly on the list, you will need to add this field to your list.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • mrleetyler Profile Picture
    270 on at

    thanks @WarrenBelz  appreciate your help. not ideal bug to come across but i think with your advise I can find a way to work around it.

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

    Hi @mrleetyler ,

     

    Could you tell me:

    Does the data submitted by the user come from the value of the textinput control?

    Do you want the value on the textinput control to remain unchanged after the user submits the data?

     

    If my assumptions are correct, you could try to set a variable.

    The value of the variable is the value of textinput control.

    You could try to assign the value to the Default property of the textinput control.

    Then set the Reset() function on the onselect property of the submit button.

     

    I did a test for you:

    1\ Add a textinput control and set its Default property to:

    Thevar

     

    2\ Add a button control and set its onselect property to:

    Set(Thevar,TextInput1.Text);Patch(LIST57,Defaults(LIST57),{Title:Thevar});Reset(TextInput1)

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

  • WarrenBelz Profile Picture
    156,545 Most Valuable Professional on at

    @v-xiaochen-msft ,

    Yes, but that would only take care of one item in the gallery (or set them all to the same value). You need to store each one to get them all back.

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

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard