What File Formats Can I Upload to Screen Flow
In this mini series of posts, I'm covering some basic means to use Flow to piece of work with uploaded files.
Certain, you'll acquire how to upload a file, but besides so much more:
- Empathise the reasons to use Flow to upload files
- Learn some basics about the Salesforce Files data model
- Install and attempt out v sample flows for uploading and manipulating files
- Review a few good ideas that demand your vote
- Become some suggestions for how to get even bigger with file uploads
Once you install and setup this package (run into beneath), y'all can jump to one of the posts in this serial to dive correct in:
- Apply Case #i: Upload a Single File
- Use Case #2: Upload Multiple Files
- Use Case #3: Rename an Uploaded File
- Use Case #four: Complete Fields on a File
- Use Case #5: Relate a File to Multiple Records
Why Upload Files with Flow?
Mitch: yous can upload a file right on a tape's File related list! Why carp? That related list upload feature is great, but it's basic. Your Salesforce tape doesn't know or actually care that a file was uploaded. And when a file is really necessary or required, how are you planning on enforcing that?
Upload files with Flow to…
- Seamlessly integrate file upload steps into a larger Menstruum-based user process
- Require certain files to be uploaded
- Collect additional user-provided details near files using custom fields
- Rename files to standardize how they are stored and appear in related lists
- Automate how files are shared with all the right users and related records
- Practice cool stuff!
Some Nuts Nigh the Salesforce Files Data Model
The showtime step to success is understanding what objects are involved in working with Salesforce Files, which is where Salesforce stores a file y'all upload. There are several you may want to acquire most, only these are the key objects:

When you upload a file from a record'due south Files related list, it creates aContentDocument; the file details are stored as a relatedContentVersion; and its relationship to the current record is stored as aContentDocumentLink.
ContentDocument – This is the main record of the file you've uploaded to Salesforce Files.
- Think of it as a container or envelope for the file, all previous versions of information technology, and whatever metadata. Fields on the ContentDocument record are updated to reflect the latest ContentVersion record.
- Key field(south): Id, LatestPublishedVersionId
ContentVersion – A version of the file you've uploaded as a ContentDocument.
- Each file tin have dissimilar versions, and all of those previous versions are available to your Salesforce users. This is great for a lot of reasons. Just think: not only do your users have access to the change history for your file, just you never have to worry almost deleting an former file and creating a new one – your users can just keep coming back to the aforementioned file, the same URL, and see the latest version (and access the previous ones).
- Y'all can create custom fields on ContentVersion.
- Y'all tin can apply record types on ContentVersion.
- Primal field(south): ContentDocumentId, Id, IsLatest
ContentDocumentLink – This is a junction object that links your file (ContentDocument) to records in Salesforce.
- Information technology is literally an association that shares it with the record and users that have access to that record.
- The "Linked Entity" can be a record in a standard object, a custom object, a user… pretty much anything.
- As a junction object, it facilitates 1-to-many relationships: a ContentDocument only has to be uploaded and stored once, but it tin appear wherever it is needed by your users.
- Primal field(s): ContentDocumentId, LinkedEntityId, ShareType, Visibility (then, ya know, all of them)
Sample Flows – How to Install/Access

Enjoy this Whitman's Sampler of flows to go a taste for what'due south possible (but be conscientious, one of the flows has a coconut filling). They might await similar at first glance, merely I promise they are different and they build on each other.
INSTALL UNMANAGED Packet
(THIS SOFTWARE PACKAGE IS COVERED By THIS DISCLAIMER)
After installation, add the E01_000_SampleFlowLauncher flow to an active Case Lightning tape page – this will nowadays you with a menu of all sample flows to use.
When adding any of these flows to a Lightning page layout, in the component properties, you will need to cheque the "Pass tape ID into this variable" checkbox for the caseRecordId input variable.
These sample flows are setup to associate files to Cases, but these aforementioned patterns will work with any object. Also, since these are fully functional, you lot could add them to an existing flow using the Subflow interaction element.
My approach and the sample flows I'one thousand providing are by no means perfect for every use case, and I brand lots of room for the possibility that someone else has a better fashion of using Flows for file uploads. But that'southward what makes Salesforce and so dandy – there's almost always more than one way to exercise something.
Some Limits
Record-Triggered Flows. You can't use Record-Triggered Flows for ContentDocument, ContentVersion, and ContentDocumentLinks (womp womp), limiting the automation that's possible when created, updated, and deleted. A workaround for ContentVersion might be to use a trigger to publish a Platform Effect, and so use a Platform Consequence-Triggered Flow.
Standard File Upload Component. The standard File Upload screen component isn't perfect – merely don't permit the search for a perfect component become the enemy of a "good enough" component. Information technology'due south nevertheless wicked awesome. Simply here are some of the shortcomings to plan around:
- Once a file is uploaded and you lot click "Done" to close the modal, the File Upload component looks merely as empty equally it did when y'all began. Information technology can be difficult for a user to know the file was truly uploaded and they can go along. Just see Max Flow #1 (above) for a corking alternative.
- Standard component can be used multiple times in a row, and will create files every time. So if your program is to process each uploaded file in a special ways, similar in Use Cases #iv or half-dozen, your loops might have more records in them than you realize.
DML/SOQL Limitations. Several of these sample flows rely on loops to go or update files that accept been uploaded. There are limits in place on the number of DML and SOQL statements – the Create, Delete, Go, and Update elements in your flow – that can exist executed. This can be a problem in loops, where you may not be able to predict the number of times the loop will iterate. For loops that include DML and SOQL statements and volition iterate over a lot of values, you'll probably need to build loops that assign updated records to a collection, so that you tin majority update all the looped records at once. For some of the to a higher place use cases, you may need to offset get records based on a drove of tape Ids – which can use this solution from Salesforce Binge to hands create that query.
Querying for Multiple Files. It doesn't really use in these scenarios, but y'all should know that directly querying ContentDocument and ContentVersion objects won't render all the files a user has access to – you can't blindly query these objects, you have to accept a certain ContentDocument Id, which means (in most cases) you're returning a unmarried file. For the near part, you volition demand to exist querying ContentDocumentLink for any query returning more than ane Content Document.
Please Help These Great Ideas!
In that location are some great ideas for enhancing Flow-based file uploads in the Salesforce IdeaExchange. Delight consider upvoting for the post-obit:
- Validation Feature for File Upload Component in Screen Flows , posted by Kshitij Shah
- Allow Content Document to be accesible on Record-Trigger Catamenia , posted by Paulina Cajiao
- Menstruation: Support equivalent of SOQL "IN" condition in Tape Filters , posted by Allan Birchenough
For Maximum Catamenia, Turn the Tap On Full
There is a whole broad world out there – lots of ways to apply Flow to do some terrific things with files. Try out these components to extend what you need to do in Flow.
Improved File Upload in Menstruum Screens

This is a wonderful alternative to the standard File Upload screen component for single and multiple file uploads. Two cardinal differences:
- Shows the user a list of the uploaded files
- Can be marked equally a required input, which tin simplify your overall flow
I tin can't enlarge how terrific this component is. To learn more and install:https://unofficialsf.com/from-josh-dayment-improved-file-upload-in-catamenia-screens/
Import Data from CSV Files Using Salesforce Flow

Once a CSV file has been uploaded, use this Catamenia Action to convert the CSV file into Salesforce records.
To learn more and install:https://unofficialsf.com/narender-singh-brings-csv-imports-to-catamenia/
Source: https://thisoldcloud.app/2021/10/29/uploading-and-working-with-files-in-flow/
0 Response to "What File Formats Can I Upload to Screen Flow"
Post a Comment