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

Duplicate entry from Gallery on button click

I want a button to be placed in gallery onclick will duplicate the item in the list. what should be the formula that needs to be used on the Onclick in button

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

On the OnSelect of the button inside the gallery:

Set(CollectionName,ThisItem);

Patch('[dbo].[DataSource]',Defaults('[dbo].[ DataSource]'),
{FirstName: CollectionName. FirstName,
ReceipientName: CollectionName.ReceipientName,
FullName: CollectionName.FullName,
EntryDate: CollectionName.EntryDate})

 

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

 

Change Label1.Text to the textbox or Label1.Text in the Gallery

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

4 REPLIES 4
Highlighted
Super User III
Super User III

Please follow this:
2. Insert an Icon1 or button1 into YourGallery1


Set the Onselect of the Icon1 to; Select(Parent);Set(CollectionName,ThisItem) . This will create a variable of the item clicked

 

3. Insert a another button2 on your screen not in the gallery and put the onselect to the following Patch:
Patch('[dbo].[DataSource]',Defaults('[dbo].[ DataSource]'),
{FirstName: CollectionName. FirstName,
ReceipientName: CollectionName.ReceipientName,
FullName: CollectionName.FullName,
EntryDate: CollectionName.EntryDate})

 

Note; Point 2 above would create the collection1 while point 3 would insert the created items in the collection into your dataSource

 

Kindly change the datasource and column names to yours.

 

https://powerusers.microsoft.com/t5/Building-Power-Apps/collection-from-an-edit-form-and-save-to-ano...

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Highlighted

Can we make the duplication in one click i.e in one button

Highlighted

On the OnSelect of the button inside the gallery:

Set(CollectionName,ThisItem);

Patch('[dbo].[DataSource]',Defaults('[dbo].[ DataSource]'),
{FirstName: CollectionName. FirstName,
ReceipientName: CollectionName.ReceipientName,
FullName: CollectionName.FullName,
EntryDate: CollectionName.EntryDate})

 

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

 

Change Label1.Text to the textbox or Label1.Text in the Gallery

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

Highlighted

Thank you very much

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (10,738)