cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate III
Advocate III

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

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

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
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,985)