I am using lightning:fileUpload component in flows embedded on community page. I want to make this mandatory/ required so that the user sees an error if they click next without uploading a file. I have tried creating a custom footer component and passing attributes from file upload component to validate but not sure how I can display error. Is there any other way to make lightning:fileUpload required in flows ? Thank you.
2 Answers
I've used a workaround that uses a "Decision" if there is no file attached. If the file ID I am passing through is blank, I have it show a screen that informs them a file is required and then takes them back to the file upload. Hoping they will come out with a way to do this without the workaround!
You might try creating a wrapper component for lightning:fileUpload that exposes a validate method. The method could check if the user has uploaded anything and return the custom error message.
Here is more info on the validation method: https://releasenotes.docs.salesforce.com/en-us/winter19/release-notes/rn_forcecom_flow_validate_attribute.htm