Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Do not reset the textinput of a gallery

(1) ShareShare
ReportReport
Posted on by 691
Hello !! I created a Power Apps screen and on it I display a gallery connected to a SharePoint list. For each item in my list, I have a "Save" icon that allows me to save each change made to each line. However, when I modify my textinputs of different lines (without saving) and then I save a line, everything that I had entered in the textinputs of the other lines is reset. How to prevent this reset?
Thanks in advance !!
 
  • s44 Profile Picture
    691 on at
    Do not reset the textinput of a gallery
     
    @Amol-Kavnekar i tried what you told me but values ​​don't save in SharePoint
     
  • s44 Profile Picture
    691 on at
    Do not reset the textinput of a gallery
    @Amol-Kavnekar i tried what you told me but values ​​don't save in SharePoint
  • Amol-Kavnekar Profile Picture
    123 on at
    Do not reset the textinput of a gallery
    The problem you are having may be due to how Power Apps handles the context and position of the controls in the gallery. Interacting with a control in a platform can update the entire platform, thus returning inputs from other rows.
    To prevent this, you can use a combination of local variables or collections to temporarily store user inputs. This way, the inputs will not be lost when the gallery is updated.
    There is a step-by-step approach to this.
    1. Use archive to store temporary data:
      • Create collections to temporarily store input values.
      • ClearCollect(TempData, MyList)
        
        LookUp(TempData, ID = ThisItem.ID).Title
        

    2. Update the collection as the filler changes:
      • Use the OnChange property of each input control to update the collection whenever the input value changes.
      • UpdateIf(
            TempData,
            ID = ThisItem.ID,
            { Title: TextInput1.Text }
        )
        

    3. Add the collection to a SharePoint list:
      • Use the OnSelect property of the Save icon to patch data from a collection into a SharePoint list.
      • Patch(
            MyList,
            LookUp(MyList, ID = ThisItem.ID),
            LookUp(TempData, ID = ThisItem.ID)
        );
        Notify("Item saved successfully", NotificationType.Success)
        

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard