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 / Bug: Gallery with text...
Power Apps
Answered

Bug: Gallery with textbox control shows the wrong default value

(1) ShareShare
ReportReport
Posted on by 284

 

Hi,

 

I have noticed that the default value of a textbox nested within a gallery control will have the following behaviour which may be a bug. I have put together the following example to demonstrate the bug.

 

Step 1. Insert button1, which will populate a collection by setting the OnSelect formula to

             >>   OnSelect = Collect(Collection1, {Column1Name: “test”})

 

Step 2. Insert a gallery control and set “Collection1” as the data source.

            >>    Items = Collection1

 

Step 3. Insert a textbox into the gallery control. Set the default property of the textbox to the Colum1Name

            >>    Default = Column1Name

 

Now each time when you click “Button1” you will see a new row added to the gallery with the “test” string displayed.. as expected.

Bug_Report1

 

Step 4. Type a new string into the text box on the first row of the gallery. Now press button 1. Each time you press “button 1” now the default value of the textbox is no longer the Colum1Name value as expected.

 

Bug_Report2

 

Has anyone else experienced this issue or able to offer a work around?

Categories:
I have the same question (0)
  • PeteMc Profile Picture
    168 on at
    If you go to view the collection from the file menn has it been updated or is it still the original value?
  • AnthonyPhan Profile Picture
    284 on at

    hi @PeteMc

     

    The underying collection data is still the same. Infact if add an additional label displaying the value it will show correctly

    image.png

  • Verified answer
    PeteMc Profile Picture
    168 on at

    On testing I am having the same issue, a workaround was to reset the gallery at the same time as adding the new item to the collection. I have attached a demo app with this workaround.

     

    The issue with the workaround is that you loose the data you modified at the top, you could have an onChange event on the text box save back to the collection to prevent the data loss.

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

    Hi @AnthonyPhan,

     

    I have made a test and the issue is confirmed on my side.

     

    I would post this issue to my product team, if the issue is solved, I would reply here.

     

    In addition, as an alternative solution, I agree with @PeteMc's thought almost. You could consider take a try to reset your Gallery control before adding a new row into your Gallery.

     

    I have made a test on my side, please take a try with the following workaround:2.JPG

     

     

    Set the OnSelect property of the Button control to following formula:

    UpdateContext({GalleryItems:Blank()});
    Collect(Collection1,{Column1Name:"test"});
    UpdateContext({GalleryItems:Collection1})

    Set the Items property of the Gallery control to following:

    GalleryItems

     

     

    In addition, if you want to save the modification within your Gallery control, please take a try with the following workaround:3.JPG

     

    Set the OnSelect property of the Button control to following formula:

    UpdateContext({GalleryItems:Blank()});
    Collect(Collection1,{Column1Name:"test"});
    UpdateContext({GalleryItems:Collection1})

    Set the Items property of the Gallery control to following:

    GalleryItems

    Set the OnChange property of the Text input control within the Gallery control to following formula:

    Clear(Collection1);
    ForAll(Gallery1.AllItems,Collect(Collection1,{Column1Name:TextInput1.Text}))

     

    Best regards,

    Kris

  • AnthonyPhan Profile Picture
    284 on at

    I apreciate everyones suggestions. All have been very usefull. 

    The work around I have used is to save the contents of the gallery to Collection1 everytime button 1 is pressed, Making sure the save happens before creating a new row in collection 1. 

     

     

  • AnthonyPhan Profile Picture
    284 on at

    Any Response from the production team? It would be good to get a long term fix for this rather than work arounds.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 834

#2
Valantis Profile Picture

Valantis 533

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard