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
AliaBurdickAliaBurdick 

Flow file:upload component not working when called from VFP in Lightning

I have a flow called from a VFP that needs to utilize the Upload Files component in the flow. Since this component only works if the flow runs in Lightning Runtime, this has been enabled in our org. It turns out though, that any flow called from a VFP will by default render in Classic, EVEN IF Lightning Runtime is enabled.

I followed the directions in this document (https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_flows_lightningruntime.htm) to create a Lightning Component extending Lightning Out with a dependency on lighting:flow. Then I updated the VFP to call this component and launch the flow. 

This did result in the flow seemingly to run in Lightning Runtime vs Classic (at least visually it did). Unfortunately, the upload file component still does not work, even with this solution in place. 

Does anyone have any idea how I can get this file upload component to function to work when called from a VFP in Lightning Runtime? I'm stumped. 

Code as its implemented now is below - I haven't set any of the finish behavior or outputs yet. 
<aura:application access="global" extends="ltng:outApp" >
    <aura:dependency resource="lightning:flow"/>
</aura:application>
<apex:page standardController="Stipulations__c" recordSetVar="stipulations">
   <html>
      <head>
         <apex:includeLightning />
      </head>
      <body class="slds-scope">
         <div id="flowContainer" />
         <script>
             var statusChange = function (event) {
               if(event.getParam("status") === "FINISHED") {
                  // Control what happens when the interview finishes
 
                  var outputVariables = event.getParam("outputVariables");
                  var key;
                  for(key in outputVariables) {
                     if(outputVariables[key].name === "myOutput") {
                        // Do something with an output variable
                     }
                  }
               }
            };            $Lightning.use("c:LightningRuntime", function() {
               // Create the flow component and set the onstatuschange attribute
               $Lightning.createComponent("lightning:flow", {"onstatuschange":statusChange},
                  "flowContainer",
                  function (component) {
                     // Set the input variables
                     var inputVariables = [
                        {
                           name : 'inputOpptyId',
                           type : 'String',
                           value : "{!$CurrentPage.parameters.Id}"
                        }
                     ];
                     
                     // Start an interview in the flowContainer div, and 
                     // initializes the input variables.
                     component.startFlow("Stipulations_Submit_Documentation", inputVariables);
                  }
               );
            });
         </script>
      </body>
   </html>
</apex:page>


 
ethanoneethanone
I have the same problem I'm trying to solve.  Looking at what you've got, where did you reference the aura app?
ethanoneethanone
I think i got it. Line 21 is where you specify the lightning app you created. (sorry if you knew that, lightning is new to me). Mine is called ltngApp and it seems to be working for me once I specified that.

My code differs from yours in that I removed the recordSetVar in the apex:page tag and removed the inputVariables in the component.startFlow (line 37). I'll need to put those back at some point.
Santosh Kumar Sriram 2323Santosh Kumar Sriram 2323
@AliaBurdick

Did you find the solution to this?I have the exact same as well!
Basant Kumar VermaBasant Kumar Verma
Its been an old post but I faced same issue and I get to know that Flow File Uploader is not supported in Lightnig Out
Check the docuementaion here https://help.salesforce.com/s/articleView?id=sf.flow_ref_elements_screencmp_fileupload.htm&type=5

User-added image