cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

How to save and delete the gallery items to sharepoint

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

7 REPLIES 7
Highlighted
Community Champion
Community Champion

Re: How to save and delete the gallery items to sharepoint

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.

Highlighted
Helper III
Helper III

Re: How to save and delete the gallery items to sharepoint

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?

Highlighted
Community Champion
Community Champion

Re: How to save and delete the gallery items to sharepoint

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.

 

Highlighted
Helper III
Helper III

Re: How to save and delete the gallery items to sharepoint

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?

Highlighted
Community Champion
Community Champion

Re: How to save and delete the gallery items to sharepoint

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.

Highlighted
Helper III
Helper III

Re: How to save and delete the gallery items to sharepoint

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

 

 

Highlighted
Community Champion
Community Champion

Re: How to save and delete the gallery items to sharepoint

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.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,888)