cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Murderbot
Level: Powered On

Populate Attachment in EditForm with Collection

I would like to populate the attachment field in an edit form with a previously uploaded attachment.  I've gotten most of the way there by using the following on the OnAddFile Action of the Attachement Data Card:

ClearCollect(receiptCopy, DataCardValue9.Attachments)

which saves name and value in a collection:

image.png

Then, in the items action of the Attachment data card, I populate it with this code:

If(anotherOne=true,receiptCopy,Parent.Default)

so that if the user wants to keep the receipt for the next entry, it will populate DataCardValue9.items with the collection table as below.  

image.png

When I try to open the file, however, if gives the above "Couldn't download the file" error.  When I submit the form, the rest of the data is saved to the Sharepoint list but not the attachment.

 

There was one other thread by @HN and answered by @v-monli-msft on this last year saying this couldn't be done, but I was hoping that perhaps there was movement forward and I just need to get my code right.

 

Thanks for your assistance!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Populate Attachment in EditForm with Collection

Hi @Murderbot ,

Do you want to collect the attachment files into a Collection, and then use it within another entry and submit it to your SP list?

 

I have made a test on my side, and don't have the error message ("Couldn't download the file") that you mentioned. The screenshot as below:13.JPG

 

But currently within PowerApps, we could not still upload a attachments file stored within a Collection to a SP list.

 

Actually, the Attachments control within PowerApps could only upload attachments which are marked as "Unsaved" to SP list or CDS Entity currently:14.JPG

If you want to upload attachment file stored within a Collection into your SP list, I afraid that there is no way to achieve your needs in PowerApps currently.

 

If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

Best regards,

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
Community Support Team
Community Support Team

Re: Populate Attachment in EditForm with Collection

Hi @Murderbot ,

Do you want to collect the attachment files into a Collection, and then use it within another entry and submit it to your SP list?

 

I have made a test on my side, and don't have the error message ("Couldn't download the file") that you mentioned. The screenshot as below:13.JPG

 

But currently within PowerApps, we could not still upload a attachments file stored within a Collection to a SP list.

 

Actually, the Attachments control within PowerApps could only upload attachments which are marked as "Unsaved" to SP list or CDS Entity currently:14.JPG

If you want to upload attachment file stored within a Collection into your SP list, I afraid that there is no way to achieve your needs in PowerApps currently.

 

If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

Best regards,

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,971)