Lightning Flow allows us to automate business processes by building applications, known as Flows. Using Flows, a user can collect information; or, they can update, edit, or create records in Salesforce. Furthermore, Flows can execute logic, interact with the Salesforce database, call Apex classes, Platform Events, and guide users through various screens to streamline the process of collecting and updating data. Once a Flow is built, an Admin can make the Flow available to the right users or systems. After Salesforce Recent release system administrator can create a Flow that can fire when a record is created or edited.
After Spring’18 release, however, with just a few clicks, users can now attach files Contract, or other Objects, via a Flow! For example, you can build a Flow that allows your sales rep to create a Contract and then attach a Contract PDF file through a Flow.
An Admin can allow users to upload files from a Flow by adding the File Upload (Screen Component) to a Flow’s screen, as shown in the following screenshot:
Furthermore, an Admin can also customize Accepted Formats in a Flow to further specify which image file formats a user can upload. However, note that any files, that are either non-images or are not in the Accepted Formats, cannot be uploaded! This change applies to the Lightning Experience and Salesforce iOS app. Also important to note here is that the File Lightning Component works only for Flows that use Lightning runtime.
In this article, I am going to show you how one can use the File component in a Flow and then make it available to business users. Let us start with a business use case.
Business Use Case
Edward Backhouse is a System Administrator at GurukulOnCloud (GoC). He received a requirement to create a Flow that allows reps to create Leads and upload their business cards from it. The requirement also includes the following tasks:
- Reps must be able to upload multiple Business Cards of prospects that belong to the same company
- And, secondly, the Reps must only be able to upload files of type .jpg, .png and, .Pdf.
Solution for the above business requirement
There are a few possible solutions for the above business scenario. For example, you can use Evernote or similar applications – that allows a user to scan business cards from mobile and auto-create leads into Salesforce. However, our purpose, in this blog, is to learn Flow and its advanced/new features. Therefore, we will use Flow and the new File lightning component to solve the above business requirement. To do so, follow the steps listed below:
- Navigate to Setup (Gear Icon) | Setup | Process Automation | Flows in Lightning Experience.
- Then click on the New Flow button and select Screen Flow it will open the Flow canvas for you.
- Create a sample Flow (add two components to store First name, Last Name, and Company) as shown in the following screenshot:
–> Remember, to create a Lead we need LastName and the Company information of prospects; for, these are required fields! However, feel free to add more fields if your use case calls for additional fields. Read the rest of this entry!