cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Download all attachments with one button

I have a SharePoint list where I can have some attachments on each row.
I'm trying to make a button that downloads all attachments from a set of filtered rows.

 

ForAll( RenameColumns( Filter(Document; Project.Value = 888885); "ID"; "IDdocs") ;
    Collect(colTrying1; {Value: IDdocs});;
    ForAll(  LookUp(Document; IdDocument = Last(colTrying1).Value ).attachments;
        Download(AbsoluteUri);;
        Collect(colTrying2; AbsoluteUri);;
    )
)

 

In this code no downloads are made (and there are files) and the colTrying2 collection always remains empty.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: Download all attachments with one button

Hi @AlamBaier ,

I will give you a process I use and see if it suits your needs. A number of my apps have a simple process of taking a photo and then using the attachment control to attach it to the SharePoint list item. All attachment images are then displayed as thumbnails in a gallery for the user to review (rather than open each one).

The process is fairly simple - firstly I will call the Attachment Control AttachPhotos and the Collection colPhotos. I have a button to refresh/initiate the view, but this could be done in other ways. So on the OnSelect of the button

ClearCollect(
    colPhotos,
    AttachPhotos.Attachments
)

this puts all the attachment details, including content into the collection colPhotos.

Now in my gallery, which has an image control, the Items are colPhotos and the Image Control Image property is

 Text(ThisItem.Value)

You can also display other metadata such as the date and time the picture was taken and the file name.

Does this address what you are trying to do?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

2 REPLIES 2
Highlighted
Community Champion
Community Champion

Re: Download all attachments with one button

Hi @AlamBaier ,

I will give you a process I use and see if it suits your needs. A number of my apps have a simple process of taking a photo and then using the attachment control to attach it to the SharePoint list item. All attachment images are then displayed as thumbnails in a gallery for the user to review (rather than open each one).

The process is fairly simple - firstly I will call the Attachment Control AttachPhotos and the Collection colPhotos. I have a button to refresh/initiate the view, but this could be done in other ways. So on the OnSelect of the button

ClearCollect(
    colPhotos,
    AttachPhotos.Attachments
)

this puts all the attachment details, including content into the collection colPhotos.

Now in my gallery, which has an image control, the Items are colPhotos and the Image Control Image property is

 Text(ThisItem.Value)

You can also display other metadata such as the date and time the picture was taken and the file name.

Does this address what you are trying to do?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

Highlighted
Frequent Visitor

Re: Download all attachments with one button

Thank you @WarrenBelz !That is... I created a hidden gallery. And I added in this gallery only 1 attachment control called attFiles.
Then in my download OnSelect button I did:

ForAll( 
   Filter(glrAttachmetns.AllItems;'has attach'); 
   Collect(colAnexos; attFiles.Attachments )
);;
ForAll( 
   RenameColumns( colAnexos;"Value";"MyLink") ; 
   Download("https://domain.sharepoint.com/sites/MySite" & Substitute( 
      MyLink;"%252f"; "/"))
)

PowerApps needs better attachment control. It would be perfect if you had the possibility to zip it and then save the attachment ... But ok!

Helpful resources

Announcements
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 (6,677)