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 / How to save and delete...
Power Apps
Unanswered

How to save and delete the gallery items to sharepoint

(0) ShareShare
ReportReport
Posted on by 109

Hi guys,

I've made a gallery as shown. This is temp table, and when I click the add button that will create a new row of text input in temp table. But how to delete the last row of temp table and how to save the all text input to sharepoint.

未命名1.png

Categories:
  • WarrenBelz Profile Picture
    156,958 Most Valuable Professional on at

    Hi @kit1128 ,

    To Remove the last item in a collection

    Remove(
     ItemsCollection,
     Last(ItemsCollection)
    )

    To add to a SharePoint list

    Patch(
     YourSharePointListName,
     Defaults(YourSharePointListName),
     { 
     CollectionField1:SharePointField1
     CollectionField2:SharePointField2
     CollectionField3:SharePointField3
     }
    )

     

    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.

  • kit1128 Profile Picture
    109 on at

    HI @WarrenBelz ,

    Thank you for reply, but under different scenario, the number of added rows will be different. So what other methods can save the data?

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

    Hi @kit1128 ,

    You just need to wrap a ForAll around the Patch

    ForAll(
     ItemsCollection,
     Patch(
     YourSharePointListName,
     Defaults(YourSharePointListName),
     { 
     CollectionField1:SharePointField1
     CollectionField2:SharePointField2
     CollectionField3:SharePointField3
     }
     )
    )

     

    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.

     

  • kit1128 Profile Picture
    109 on at

    Hi @WarrenBelz 

    Thank you for reply, I've some problem in add button, Although it added a new row in temp table, how can add the text of text box in temp?

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

    Hi @kit1128 ,

    You will have to explain in a bit more details here. Which text box are you trying to add  with the button. You are currently sending the number of rows.

  • kit1128 Profile Picture
    109 on at

    HI@WarrenBelz ,

     

    As I want to do add a Text input control dynamically within the screen when you click the Button control. So, I consider take a try to embed the Text input control into a Gallery control. But How to access the data or content in those dynamic controls? Using the same example, the text input, how do I access the content of the the first, second, third, Fourth textfield text that are generated dynamically? 

     

    The onvisible property of the screen

    on.pngThe Add button control

    add.png
    Collectioncol.png

     

     

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

    Thanks @kit1128 ,

    I am still a little unsure on exactly what you want, but if you are putting a Text Input into the gallery and want to write them all to separate records, go back to my second post with the ForAll, but Patch Gallery.Selected.TextFieldName

     

    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.

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 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard