function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ryan OlsenRyan Olsen 

How do you restrict the file size in files for a specific object in a screen flow?

VinayVinay (Salesforce Developers) 
Hi Ryan,

I dont think you will be able to restrict in flow screen input component on file size and limit of file upload method is 3.5 MB.

https://unofficialsf.com/from-josh-dayment-improved-file-upload-in-flow-screens/

Please mark as Best Answer if above information was helpful.

Thanks,
Arun Kumar 1141Arun Kumar 1141
Hello Ryan,

To restrict the file size for uploads in a screen flow, you can implement the following steps:
  1. Begin by creating a number variable within the screen flow to represent the maximum file size limit. Assign an appropriate value to this variable, indicating the desired file size limit in bytes.
  2. Include a File Upload component in your screen flow, enabling users to upload files.
  3.  After the File Upload component, add a Decision element to evaluate the file size against the maximum limit.
  4. Configure the Decision element to compare the size of the uploaded file with the MaxFileSizeLimit variable, using the "Compare Values" operator.
  5.  Define the outcomes of the Decision element based on the comparison result. For instance, create separate paths for files within the size limit and those that exceed it.
  6. Within each outcome path, specify the desired actions or messages. For files exceeding the limit, display an error message to the user, instructing them to select a smaller file. For files within the limit, proceed with the subsequent steps in the flow.
  7. Save and activate the flow to enforce the file size restriction within the screen flow.
By following these steps, you can effectively restrict the file size for a specific object in the screen flow. Users will receive notifications if they attempt to upload files that surpass the specified limit, allowing you to control the maximum file size in the flow.

Please mark it as best, it it helps you.
Thank you.