cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate II
Advocate II

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

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?

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

@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.

View solution in original post

4 REPLIES 4
Super User III
Super User III

@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.

View solution in original post

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.

Microsoft
Microsoft

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.

@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.

Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Solution Authors
Top Kudoed Authors
Users online (88,994)