Global API
...
Code Examples
File Upload for Flow

Flow (Screen Flow)

2min



The Flow portion of File Upload is where all user interaction and file decision making take place. Just another typical flow, however with a little added functionality of Apex Action that was created by deploying the Apex Class for file upload.

Main notes are that passing the ID of the record which started the screen flow still has issues to work through. This is easily solved: Add a flow variable of type text named: recordId Set the default value of recordId to: {!$Flow.CurrentRecord}

Document image


Retrieving Attachments to Opportunities

Opportunity Attachments in Salesforce are stored in the Content Document object. We must find and pass the Document ID to the file we want to upload. For the screen flow, it's nice to display a list of existing attachments where they can select which one to send. Making use of the Data Table within flow we can retrieve the list of Content Documents in a collection, and display the colleciton in the table.



Document image

Document image