It often the case where you want to or asked to download single or multiple selected Salesforce Files. However, there is no solution available out of the box that lets you select and download multiple files.
So building on the idea shared by fellow friend, M Hamza in his post, I built a web component that allows you to select and download files from a table.
The component can be embedded onto home page to download multiple files(as a zip). This component is a very basic version which can be extended based on the business use case at hand.
The component will be available as a part of an unmanaged package.
In addition to the component, I’ve also packaged a flow action that can be used in screen flow to download multiple files at once.
The flow action accepts a list of Content Document IDs as input.
You can pair this component with other screen components and the components available on unofficialsf.com to create seamless experience for your end users and customers.
You can find the source code and link to the managed package here:
https://github.com/forcePanda/Lightning-Components-Repo/tree/master/Mass%20File%20Downloader
Hope you find this one useful! I’ll catch you in the next one. ✌
Thank you for being an awesome reader! Subscribe to this blog for receiving all the latest updates straight to your inbox. 🙂
Pingback: From Narender Singh: A Mass File Download Screen Component – UnofficialSF
This only works on a home page, can it be amended to work on a record page?
LikeLike
Wow, works nice and clean! To get it working on a per record basis, you need to get a list of the Content Document Ids related to the record.
To do this, get ContentDocumentLinks where the RelatedEntityId is the id of your record. Then you need to pass a list of the ContentDocumentIds from that collection to the Mass File Downloader Action. This can all be done in Flow.
The user gets a zip file with all of the documents. It’s nice and quick!
LikeLiked by 1 person
When I open this up in Flow it only allows me to pass through a single variable. What do you mean pass a “list” is this not a collection variable of all the Content Documents?
LikeLike
Have downloaded via the link above – it does not contain a sample flow.
when trying to use the apaex action in the flow we are told we have reached the limit for the actions
should there be a flow screen component ?
LikeLike
You should see the flow in the list of flows.
LikeLike
Can you share screenshots (as links) of the limit reached error?
LikeLike
Can you please explain further what you mean by pass a “list” it looks like it only accepts a single variable but I want to use this to download more than one file but it does not accept Content Document IDs as a collection. Thanks!
LikeLike
Are you using the action in the flow?
LikeLike
Yes. I have a screen flow I created where I get content document IDs of a related child object and assign them to a collection. I assumed the action I downloaded from your package would accept a collection. How does it work?
LikeLike
Hmm.. it “should” accept a collection from what I’m seeing in the code.
The collection variable you created, can you confirm if it’s of Text type?
LikeLike
No, it is of record type. Should the collection text type just be the record id separated by “;”?
LikeLike
Ahh… that’s why. You must create a text type collection and then add the Content Document IDs to this collection and use this variable as an input to the action
LikeLike
That worked, amazing, thanks so much!
LikeLiked by 1 person
i Download the basic version, but nothing happen while using the flow.
LikeLike