In Salesforce, we create and implement flows to automate the data process and maintain records in the org. With the help of a Salesforce flow, we can also upload files to records or related records.
In this Salesforce tutorial, I will explain the method to upload files using Screen Flow in Salesforce.
Upload Files Using Screen Flow in Salesforce
We can use the Screen flow to upload files for two use cases:
- Uploading files for the current record.
- Uploading files for the related records.
Upload Files Using Screen flow for the current record
To create a Screen flow for uploading the files in Salesforce, open your Salesforce developer console and follow the below steps.
1. On the setup page, go to the Quick Find box and then search and select Flows under the heading Process Automation.

2. In the Flows setup window, click on the button New Flow.

3. In the Salesforce Flow builder, click on the “+” icon on the flow and add the Screen element.

4. Enter the label and API Name for the screen, then from the left sidebar, drag and drop the File Upload component.

5. Enter the API Name and File Upload Label. The label will be displayed to the user on the screen flow.

6. In the field Related Record Id, we have to parse the id of the current record and, for that, create a New Resource for this field.

7. Enter and select the below fields to create a resource for getting the ID of the current record.
- Select the Resource Type as Variable.
- Enter the API Name as RecordId.
- Select the Data type as Record and Object as Account.
- Activate the options available for input and output.
- At last, click on Done.

8. We have completed the screen element. Now click on Done to save this.

9. Enter the relevant name for Flow Label and Flow API Name to save this flow.

10. To use this flow, it is required to activate it; for that, click on the Activate button.

Add flow to the record page and upload a file through flow
1. Go to the Setup -> Navigate to Account tab -> Open a record -> Click on the settings icon and click Edit page.

2. Drag and drop the flow component to the template region.

3. Select the created flow from the Flow field, then activate the checkbox Pass record ID into this variable.
At last, click on the Save button to apply changes.

4. Go back to the account record page, and in the screen flow, click on Upload Files.

5. Select the file from your system, and after the upload, click on the Upload button.
Now, we can view the uploaded files in the Files and Attachments section on the record page.
In this way, we can upload files using screen flow for the current record by following the above steps.
Upload Files Using Screen Flow for the Related Records
In the below steps, we will create a screen flow when we create a contact for an account, and the contact ID will be stored in the Screen element to which we will upload the file component.
We need the contact ID because the Upload file component asks for the ID of the related record (parent or child).
Now follow the below steps to create a screen flow to upload files in the related records.
1. On the Setup page of Salesforce, go to the Quick Find box and search, then select Flows.

2. In the Flows setup window, click on the button New Flow.
3. Select the option Screen flow, and click Create.

4. In the Flow builder click on the “+” icon and select the Screen element.
5. Enter the Label and Api Name for the screen, this screen will take input to create contact in the current account. For that, drag and add Text component to the screen region.

6. In this screen, I have added two text components that will take input from users. After this, enter the Label and API Name for the components, then click Done.

7. Below the Screen element, add a Create Record element.
8. Enter the below details to create the Get Record element.
- Enter a relevant Label and API Name.
- Activate the radio button; use separate resources and literal values.
- Select the Object as Contact.
- In the section Set Fields Values, we have to map the object fields with values we created in the screen flow.

9. Add another field AccountId, and to get the id of the current account record, create a New Resource.

10. Enter the below details to create resources for getting a currency account id.
- Select the Resource Type as a Variable.
- Enter the API Name as RecordId.
- Select the Data type as Text.
- Activate the checkbox Available for input and Available for output.
- At last, click on the Done button.

11. Activate the checkbox. Manually assign variables and select New Resource in the Variable field.

12. Enter the below details to create the resource that will store the ID of Account contact.
- Select the Resource type as Variable.
- Enter a relevant API Name for the resource. For example, I have entered it as StoreContactId.
- Select the Data Type as Text.
- Activate the checkbox, available for input and output.
- At last, click on the Done button.

13. After creating the Get record element, add another Screen element below that.
14. In this screen, first enter the API Name and label for the screen. After this, add the File upload component to the screen region, then add the add label api name for the file upload component also.
After this, go to the field Related Record ID and enter the value that you created for the resource in the above steps to store the contact ID, then click the Done button.

15. Now click the Save button in the flow builder. Then, in the next window, enter the Flow Label and API name, then click Save.

16. To use this flow, we need to activate it, and for that, click the Activate button.

Till we have created and activated the screen flow, after this, we need to add this flow on the record page.
Add file upload Screen flow to the Record page
Follow the below steps to add the created screen flow on the account record page.
1. Navigate to the Accounts tab -> select any Account record-> Click Settings icon -> select Edit page.

2. In the app builder, drag the flow component to the template region.

3. In the right-hand bar, select the flow in the flow that you created in the above step, then click Save.

4. Go to the record page; on the first screen of the flow, enter the details to create a contact record, then click Next.

5. In the second screen, click on the button Upload Files.

6. Select a file from your system and click on the Done button.

7. Click the Finish button on the screen flow.
8. Go to the newly created record, and there you will see the uploaded file in the Notes & Attachments.

In this way, we can Upload files using screen flow for the related records by following the above steps.
Conclusion
In Salesforce automation, we can use Screen Flow to streamline your file management processes. By following the above steps, you might have understood the process of creating a screen flow to upload files in Salesforce records.
We can use the same process to upload files through the screen for the records and related records of other data objects.
You may like to read:
- How to Add Record Type in Salesforce Flow
- How to upload files in Salesforce
- How to Attach Files to the Records in Salesforce
- How to Create a Task Using Flow in Salesforce
- How to Send Custom Notification using Flow in Salesforce

Abhijeet is a skilled Salesforce developer with experience in developing and integrating dashboards, data reports, and Salesforce applications. He is also skilled at optimizing processes and flow automation processes, coding, and executing complex project architecture. Read more about us | LinkedIn Profile.