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
BobPBobP 

lightning component with Flow used as a Global Action Button modal not closing flow final screen

I adjust my flow and it does work where a case is created and it redirects to a newly created case with no other screen works when i add the lightning component to my lightning home page layout. 

But, It is very odd when executing the same flow from a Global Action menu it still works but there is a Finish button at the end of the flow and then it returns back to the beginning of the flow. 

I don't know if there is something else I can add to change the behavior in the lightning component global action button to perform like it does on the home page or outside of the global action button. I need the last screen to go away when the user is finished. When I added  $A.get("e.force:closeQuickAction").fire() to the controller it worked a couple of time and then stop working. Maybe it's something in my loop I'm just can't get this to work consistently

Component:
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:lightningQuickAction" >

<!-- Initialize the component to show the flow -->
<aura:handler name="init" value="{!this}" action="{!c.init}" />

<!-- The marker for the flow. with a listener on the status change -->
<lightning:flow aura:id="flowData" onstatuschange="{!c.handleStatusChange}" />
    <br/>
    
</aura:component>

Controller:
({
/* Launch the correct flow */
  init : function (cmp) {
    var flow = cmp.find("flowData");
    flow.startFlow("New_IT_Support_Case");
      
  },

/*On change listener*/
handleStatusChange : function (component, event) {
   if(event.getParam("status") === "finish") {
      var outputVariables = event.getParam("outputVariables");
      var outputVar;
      for(var i = 0; i < outputVariables.length; i++) {
         outputVar = outputVariables[i];
         if(outputVar.name === "New_IT_Support_Case") 
       
         $A.get("e.force:closeQuickAction").fire()
  
  
        }
       
     }
  }    
   
})

 
ShirishaShirisha (Salesforce Developers) 
Hi,

Greetings!

Can you please share the screenshots of the working and non working scenarios(Global actio and home pagelayout variations of the flow) to check from our end.

Also,can you please try with any other simple screen flow and if it is also same then you can reach out to the salesforce support to confirm,if it is bug or working as designed.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Warm Regards,
Shirisha Pathuri