cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Murderbot
Advocate IV
Advocate IV

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
v-xida-msft
Community Support
Community Support

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
v-xida-msft
Community Support
Community Support

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Users online (1,704)