How To Use Screen-Flow to Upload Files & Make it Mandatory

How To Use Screen-Flow to Upload Files & Make it Mandatory

Uploading Files through Screen Flow is a bit tricky. We can’t use ‘Create Record’ element like we can for creating other records. And then we can’t even make the file upload mandatory like we can make other fields mandatory in Screen Flow. 

This is a question that was asked by one of our Mastering Salesforce Flows course participants and since the solution is not very straight forward, we thought of documenting the whole solution in a step-by-step guide format  and share with everyone.  

Here’s the business requirement

  • Create a Flow to create a record with Attachments (Files)
  • Make the file upload mandatory
  • If the user does not upload the file, then delete the record that was created

And here is the Flow design. Step-by-step with screenshots.

NOTE: Certain sections of the guide will appear as locked in the free preview. You can download the unlocked version of the guide in PDF format by subscribing to our “All Access” Pass through the link below.

Not an “All Access” Pass Member Yet?

Get Download Access to this & 150+ More Step-by-Step Guides with “All Access” Pass. A simple and single plan to access our entire library of courses, guides, workshops & masterclasses on Salesforce.

Introducing Mastering Salesforce Flows Training Course

Liked this post? We are now offering a complete self-paced, video-based training course on Mastering Salesforce Flows. The course comes with downloadable step-by-step PDF guides, unlimited access, free upgrades, community discussion area, free preview and more. For more details, please click here.

Need Help with Flows?

Need advice on Flows? I also offer advisory & consulting services on Salesforce Flows. So, whether you want to create new Flows or migrate existing automations (Workflow Rules, Process Builder, Triggers) to Flows, I can help you analyze, design, plan & review. To initiate a discussion, please submit the contact form here stating your requirement or schedule a discussion at this URL.

References & Useful URLs

16 thoughts on “How To Use Screen-Flow to Upload Files & Make it Mandatory”

  1. Hi Ashish,
    Thanks for the wonderful content. But I have a doubt what If the user closes the screen (by clicking on X) after entering the data. Does It create the record without files are being uploaded?
    What to do in that case. Is there any possibility to delete those records which are not having files?

    And What can we do if we want to place the data and file upload in the same screen? can we upload file to the record created in that case?
    Please answer for this. Need ur help, It’ll help me a lot..

    1. Thanks Janu, glad that you liked the content.

      1. Yes, if the user closes the screen the record will remain created without the files being uploaded. For such cases, you can write scheduled-triggered flow to run on a nightly basis to delete the records, where there are no files attached.

      2. If you notice the properties for file upload screen element, slide 26-29, we have specified the AccountId under ‘Related Record Id’. So, we need to have an Account Record Id before showing this screen to the user as once the user uploads the file, Flow automatically saves it in Salesforce, without us having to use the ‘Create Records’ element. For this reason, we have split the flow into two screens, and we need to do it in two steps.

      Hope this clarifies.

  2. for some reason, in the decision element when file is not uploaded, it skips everything else and creates the record. i have set the criteria for no using the fileidlength as youve instructed and made is less than 2. Why is it creating the record when I have other actions after?

    1. Hi Jessica, I tested it again at my end and if I don’t upload the file, it shows me the message “You have not uploaded a file. Uploading file is mandatory. If you don’t want to upload the file, the Account record that you just created won’t be saved. Please check the box below if you don’t want to upload the file.” You may want to check the configuration of your Flow again.

  3. Abhishek Kumar

    Hi Agrawal,
    I need your help for one requirement.
    In case object there is one field case origin( with three picklist value). So I want to make attachment mandatory based on two picklist value of case origin. I don’t have a attachment option to attach the file in case creation form.
    So I wanted to make attachment mandatory immediate after the case creation.

    1. Hi Abhishek, you won’t be able to do it using the standard screens. I think you will need to use Flows or LWC to create the case where you can enforce this rule.

    1. Hi Keith, My site was down till yesterday for maintenance. It is back up now. Can you please check if you are still having issues? If yes, please let me know the URL that you are trying to access and I will take a look.

    1. Hi Ranjan, do you mean you still needed to spend five hours after referring to this guide? Can you tell me where exactly you struggled so that I can update the guide?

  4. Thankyou sir, you put lot of efforts in creating those step by step slides in detail.
    please keep posting on Flows & Integrations with different applications.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top
Introducing All Access Pass