Use Case: Mark A File Upload as Required in Flow

Have you tried the File Upload component in Screen Flow but got frustrated because we can’t mark it as required? I have! This solution is a workaround to help you mark the File Upload as required (or at least it feels like it) by creating a “fake loop”. This fake loop will only break when there is a file uploaded – cool right? I love creating fake loops so much. I don’t know if this is a good practice, but at least it works great! So let’s dive in!

* Big thanks to Chuck for sending in the case!

Lulu Mobile uses the standard Account object and they want to create an Action called “Upload File”. They also want to ensure that the users upload at least one file before they can finish the flow.

We will create a Screen Flow with the File Upload component. We will also create a fake loop inside the Flow – if no file is there, link back to the upload screen; If there are files, proceed to the finish screen.

To achieve this, we will utilize the Content Document IDs variable that the File Upload component generates automatically. This variable is a collection that stores the files’ 18-digit Ids after the upload. If there is no file, it will return [ ] (empty collection); If it has more than one file, it will return [ (18-digit Id), (18-digit Id)].

Thus, we can use the LEN() formula to count how long the “Content Document IDs” collection is. 2 means it has no file, 20 means it has one file (18 + 2 brackets), 39 means it has 2 files (18 * 2 + 1 comma + 2 brackets).

Flow Chart (deactivate last login date)

Steps (deactivate last login date)

Please wait while flipbook is loading. For more related info, FAQs and issues please refer to DearFlip WordPress Flipbook Plugin Help documentation.

Screen FlowAssignmentFormula

Does the solution solve your problem? If not, write us what your problem is and we will build the flow for you!

Official Salesforce Help Article On Flow

Notify of
Newest Most Voted
Inline Feedbacks
View all comments

Thank you!! You saved me:)