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
RamChandra09RamChandra09 

Upload Files Button is showing Disable in Flow

User-added image
Upload Files Button is showing Disable in Flow, I have given everything which is required, need help
PabitraPabitra
Dear salesforce sfdc 39,

When you are using a file upload component in a flow, the component must associate with any record id.In my case I have created lead in a flow and after this I am uploading a file through file upload component I have set empty string in Related Record Id filed for testing purpose and I met same problem like you.

User-added image

When you put your mouse on the help link at right of 'Related Record iD'  field you will get clear instruction as The ID of the record to associate files with. If no value is passed the component is disabled as shown in above picture.

So I hope any how in the Related Record ID field the id is null or empty string or any other string is passed instead of valid record id.Please check it with proper record ID.

Many Thanks!
Pabitra
RamChandra09RamChandra09
Hello Pabitra,

Thanks for the reply, I did the same as u said, even i have cross checked with Proper Accound Record id, even though it is not showing Account page Layout, strucked at the sameUser-added image
PabitraPabitra
Hi Ram,

When I hardcoded an account id in Related Record Id field , in my case it is working fine.I checked the coponent in both places in Home page and in record page also.
If you are passing proper id still the button is disabled, In that component there is another field called Disabled, if that value is true then also the same problem will occure.Please cross verify.

Thanks!
Pabitra
Deepali KulshresthaDeepali Kulshrestha
Hi RamChandra,
Greetings to you!

- Please use the below code : - 
Component : - 

    <aura:component>
        <aura:attribute name="accept" type="List" default="['.jpg', '.jpeg']"/>
        <aura:attribute name="multiple" type="Boolean" default="true"/>
        <aura:attribute name="disabled" type="Boolean" default="false"/>

        <lightning:fileUpload  name="fileUploader"
                               label= "Demo Upload"
                               multiple="{!v.multiple}"
                               accept="{!v.accept}"
                               disabled="{!v.disabled}"
                               recordId="abcd"
                               onuploadfinished="{! c.handleUploadFinished }"/>

    </aura:component>
    
Controller : -
    
    ({
        handleUploadFinished: function (cmp, event) {
            // This will contain the List of File uploaded data and status
            var uploadedFiles = event.getParam("files");
            alert("Files uploaded : " + uploadedFiles.length);
        }
    })

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha.
RamChandra09RamChandra09
Hi Deepali Kulshrestha,

Thanks for the reply, Am trying to achieve it through the standard Flows .