[SalesForce] Close flow screen after the Flow finishes

Calling a flow from Quick Action wasnt refreshing the screen , so I calling the Update Screen action from the https://unofficialsf.com/the-update-screen-flow-action-component/. Quick Action updates the owner of the case record to be the current through the flow. After the case is updated I see the screen like

enter image description here

Instead of showing the screen at the end of flow finishes, is there a way we can automatically close it through the Update Screen lightning component. I will save the user the key clicks every time they try to update something. I tried to add $A.get('e.force:refreshView').fire(); which would do complete refresh but I still see that screen
Component of the Update Screen

<aura:component implements="lightning:availableForFlowActions,force:hasRecordId">
    <aura:attribute name="recordError" type="String"
                    description="An error message bound to force:recordData"/>
    <force:recordData aura:id="recordLoader"
                      layoutType="FULL"
                      recordId="{!v.recordId}"
                      targetError="{!v.recordError}"
                      />
    </aura:component>

Controller

({
    invoke : function(component, event, helper) {        
        return new Promise(function(resolve, reject) {           
component.find("recordLoader").reloadRecord(true, $A.getCallback(function() {
                $A.get('e.force:refreshView').fire();
                resolve();
            }));
        });
    }})

Can anyone suggest me any options for closing flow screen automatically through the lightning component here.

Best Answer

You have available Flow Navigation Actions to you in the aura component.

enter image description here

You need to use these to control the flow execution. It seems the unofficialSF component is a flow action. You can simply add another flow screen that uses an aura component that will essentially auto-finish for you and implements lightning:availableForFlowScreens.

<aura:component implements="lightning:availableForFlowScreens,force:hasRecordId">
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
</aura:component>
({
   doInit: function(component, event, helper) {
      var navigate = component.get("v.navigateFlow");
      navigate("FINISH");
   }
})
Related Topic