cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
panand99
Solution Supplier
Solution Supplier

Upload attachment in newform using existing record (Creating exact copy of existing record)

Hi,

I want to create a excat (clone) copy of existing record on click of button with all the fields and attachments. 

 

I can able to sets all items of new record from existing record using lookup formula but not able to uload the attachments.

 

This "Initiate a Change" button opens newform with all itemsThis "Initiate a Change" button opens newform with all items

 

Formula on Change button : Navigate(scnEditRequest, ScreenTransition.Cover, {varMainRequestID:ThisItem.ID,varIsChange:"Yes"});NewForm(frmEditRequest)

 

I passed the existing record ID as an variable and used it in newform for lookup formula, all the values correctly fetchs.

 

Can anyone have any idea how I can upload the attachments when clicks on this 'change' button.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @panand99,

Do you also want to copy the attachments of an existing record when you click "Change" button?

I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:2.JPG

 

3.JPG

 

4.JPG

Within the first screen, set the OnSelect property of the "Change" button within the Gallery to following:

Set(varMainRequestID, ThisItem.ID);
Set(varIsChange, "Yes");
Navigate(EditScreen1,ScreenTransition.Cover); NewForm(EditForm1)

On your side, you should type:

Set(varMainRequestID, ThisItem.ID);
Set(varIsChange, "Yes");
Navigate(scnEditRequest, ScreenTransition.Cover); NewForm(frmEditRequest)

 

Within the Edit form of Edit screen, set the Default property of the Text Input box within the Title Data cardto following:

If(varIsChange="Yes", LookUp('20181228_case12',ID = varMainRequestID).Title, Parent.Default)

On your side, you should type:

If(varIsChange="Yes", LookUp('YourSPList',ID = varMainRequestID).Title, Parent.Default)

...

...

Set the Items proeprty of the Attachments control within the Attachments Data card to following:

If(varIsChange="Yes", LookUp('20181228_case12',ID = varMainRequestID).Attachments, Parent.Default)

On your side, you should type:

If(varIsChange="Yes", LookUp('YourSPList',ID = varMainRequestID).Attachments, Parent.Default)

Please check the following attached GIF screenshot for more details:

 

But when I click "Submit" button to upload the copied attachments to my SP list, the copied attachments could not be saved (you must re-upload attachments manually within the Attachments control). If you want to upload a copied attachments of an existing record to your SP list, I afraid that there is no way to achieve your needs in PowerApps currently.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-xida-msft
Community Support
Community Support

Hi @panand99,

Do you also want to copy the attachments of an existing record when you click "Change" button?

I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:2.JPG

 

3.JPG

 

4.JPG

Within the first screen, set the OnSelect property of the "Change" button within the Gallery to following:

Set(varMainRequestID, ThisItem.ID);
Set(varIsChange, "Yes");
Navigate(EditScreen1,ScreenTransition.Cover); NewForm(EditForm1)

On your side, you should type:

Set(varMainRequestID, ThisItem.ID);
Set(varIsChange, "Yes");
Navigate(scnEditRequest, ScreenTransition.Cover); NewForm(frmEditRequest)

 

Within the Edit form of Edit screen, set the Default property of the Text Input box within the Title Data cardto following:

If(varIsChange="Yes", LookUp('20181228_case12',ID = varMainRequestID).Title, Parent.Default)

On your side, you should type:

If(varIsChange="Yes", LookUp('YourSPList',ID = varMainRequestID).Title, Parent.Default)

...

...

Set the Items proeprty of the Attachments control within the Attachments Data card to following:

If(varIsChange="Yes", LookUp('20181228_case12',ID = varMainRequestID).Attachments, Parent.Default)

On your side, you should type:

If(varIsChange="Yes", LookUp('YourSPList',ID = varMainRequestID).Attachments, Parent.Default)

Please check the following attached GIF screenshot for more details:

 

But when I click "Submit" button to upload the copied attachments to my SP list, the copied attachments could not be saved (you must re-upload attachments manually within the Attachments control). If you want to upload a copied attachments of an existing record to your SP list, I afraid that there is no way to achieve your needs in PowerApps currently.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (3,074)