cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aswin12345
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

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
eka24
Super User
Super User

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.

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

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.

Thank you very much

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,033)