Skip to main content

#Screen Flow6 discussing

I have an aura component that currently overrides the New Case button, works great. But when the screen flow runs and gets to the end of the flow tree, I have a screen that says "your case has been created" but when you click Finish, it starts the flow over again.  How do I make this stop and redirect to the record it created?

 

<aura:component implements="lightning:actionOverride" access="global">

<aura:handler name="init" value="{!this}" action="{!c.init}"/>

<lightning:card>

<lightning:flow aura:id="flowData" onstatuschange="{!c.handleStatusChange}"/>

</lightning:card>

</aura:component>

 

({

init: function(component) {

let objFlow = component.find("flowData");

objFlow.startFlow("New_Case");

}

})

#Salesforce Developer  #Screen Flow

6 answers
  1. Jul 30, 4:36 PM

    Hi Staci, 

     

    This is actually expected behavior with lightning:flow when it's embedded in an Aura action override — the flow component automatically restarts itself when it hits FINISHED status unless you explicitly intercept that and close/navigate away yourself. The "Open a Page" flow action alone won't stop the restart because it doesn't control the lifecycle of the Aura component hosting it — it just navigates in a new context while the underlying flow component is still mounted and reacts to its own FINISHED status by resetting. 

     

    The fix: handle the status change in your Aura controller, not just via a Flow action. 

     

    1. Get the new record's Id as a Flow output 

    In your Screen Flow, create an output variable (e.g., recordId, of type Text) and set it to the newly created Case's Id right after the Create Records element. 

     

    2. Update your Aura component's onstatuschange handler 

    Instead of relying solely on the flow's internal navigation action, catch the FINISHED status and manually close the action + navigate. Replace your controller's handleStatusChange function with this: 

     

    handleStatusChange: function(component, event, helper) { 

        if (event.getParam("status") === "FINISHED") { 

            var outputVariables = event.getParam("outputVariables"); 

            var recordId; 

            for (var i = 0; i < outputVariables.length; i++) { 

                if (outputVariables[i].name === "recordId") { 

                    recordId = outputVariables[i].value; 

                } 

            } 

     

            // Close the modal or action panel 

            $A.get("e.force:closeQuickAction").fire(); 

     

            // Navigate to the newly created record 

            var navEvt = $A.get("e.force:navigateToSObject"); 

            navEvt.setParams({ 

                "recordId": recordId, 

                "slideDevName": "detail" 

            }); 

            navEvt.fire(); 

        } 

     

    3. Remove or skip the "Open a Page" flow action 

    Since navigation is now handled entirely in the Aura controller based on the FINISHED status, you don't need the Flow's own "Open a Page" element pointing at the record. That element was likely what caused the double behavior, since the flow tries to navigate and then restarts because the component underneath is still alive. 

     

    The restart happens because lightning:flow treats "Finish" as "ready to run again" by default when embedded, since it is designed for cases where you want to allow re-running the same flow instance, such as a "create another case" style behavior. By explicitly firing force:closeQuickAction as soon as you detect FINISHED, you tear down the Aura component or modal entirely before it gets a chance to reset, so there is nothing left to restart. 

     

    This pattern of catching FINISHED, closing the quick action, then navigating is the standard approach for this exact New or Edit button override plus Screen Flow plus redirect scenario.

0/9000

I am trying to configure a validation rule in my screen flow for the input of the address component. This consists of the Mailing Street, City, State, and Country. There is no "required" field to click on this component, so I am hoping to use a validation rule to make sure that all necessary fields are filled. Initially I had it set to check that all of the above fields were not blank, but in my testing I remembered that some countries do not have states. I have the list of countries with states, and I'm hoping to make a validation rule that considers the following:

 

If the country is one with states, then validate that all address fields are filled in. Else if the country is one without states, make sure that all fields except state are filled in. 

 

I am struggling to put the if, else statement in my head into a validation rule for the flow.

 

Also, validation rules in flow are different than fields within Salesforce, as the statement should return true if valid.

 

#Flow

13 answers
  1. Steven Trumble (Strum Consulting) Forum Ambassador
    Mar 1, 2024, 8:39 PM

    Sure, try this.

    Start with all the fields that should not be blank - street, city, country.

     

    Then you hvae two conditions. Either there is a Country with states (province), then state should have a value. or a country without states, then you don't need a value.

    AND(

    NOT(ISBLANK({!Address.street})),

    NOT(ISBLANK({!Address.city})),

    NOT(ISBLANK({!Address.country})),

    OR(

    AND(

    ISBLANK({!Address.province}),

    CASE({!Address.country},

    "Australia", 1,

    "United States", 1,

    "Mexico", 1,

    0

    ) = 0

    ),

    AND(

    NOT(ISBLANK({!Address.province})),

    CASE({!Address.country},

    "Australia", 1,

    "United States", 1,

    "Mexico", 1,

    0

    ) = 1

    )

    )

    )

0/9000
0/9000

Screen Flow Lookup Component Filters, Limitations and Workaround

 

To anyone who is looking into this, I hope this may help you. 

 

The Lookup screen components, as well as record variable lookup fields has limitations in screen flows. Documentation is here

Lookup Screen Input Component and the considerations states:

  • Dependent lookup filters aren’t enforced for the Lookup component in a flow. Other lookup filters are enforced the same as they are in Lightning Experience record pages. When the flow accesses the Salesforce database, lookup filters are enforced. For example, when the flow executes the Create Records element, the flow fails if the value of the lookup field doesn’t meet the lookup filter requirements.
  • Dependent lookup filters aren’t supported.

 

Consider a business scenario:

  1. User has a picklist field, referencing a global picklist.
  2. Object record also has a picklist field, referencing the same global picklist.
  3. Lookup field on object record has lookup filter, only if the picklist values are equal.

This works fine on flexipages, but not in screen flow lookup components. 

 

Workaround:

However, if the lookup filter is changed from EQUALS to CONTAINS, then the filter still works. Just note, this is then not supported. 

 

#Screen Flow  #Lookup Filter

0/9000

🚀 New Salesforce Feature Explained: Flow Embedded Analytics

 

Understanding how your Salesforce Flows behave in real time just got easier!

In my latest video on Technical Potpourri, I explore Salesforce’s new Flow Embedded Analytics feature, which brings powerful visibility directly into the Flow Canvas.

 

🔍 What’s covered in the video?

• Total flow runs displayed on each flow element

• Clear insights into execution paths and performance

• How this helps admins and developers debug and optimize flows faster

 

If you work with Salesforce Flows, this feature is a game-changer for performance analysis and troubleshooting.

 

🎥 Watch the full video here:

👉 https://youtu.be/FdfXfq6JTqo

 

 

🚀 New Salesforce Feature Explained: Flow Embedded Analytics Understanding how your Salesforce Flows behave in real time just got easier!In my latest video on Technical Potpourri, I explore Salesforce

 

@The Blog Group @* Release Readiness Trailblazers *

 

 

#Flow  #Flows  #Screen Flow  #New Releases  #Release Readiness

1 comment
0/9000

When adding a Upload File screen component, it appears from my research that you need to create the record prior then relate to the Related Record ID.  If that is the case, its a little problematic as I want all components on one nice neat screen.

 

Any suggestions or confirmation is most appreciated.

 

thanks

#Flow   #Screen Flow #Sales Cloud

5 answers
0/9000

🎉 Thanks to our Forum Ambassador @Ajaypreet Singh Saini 😍 for an awesome write-up on: How to dynamically find object prefixes to reuse same Screen Flow across multiple objects >> https://help.salesforce.com/s/articleView?id=005131979&type=1  Click to learn more! 

 

We would love to hear your feedback on our article. Please take a moment to let us know by clicking on the "Yes" or "No" button below the article.🎉 Thanks to our Forum Ambassador 😍 for an awesome write-up on: How to dynamically find object prefixes to reuse same Screen Flow across multiple objects >> Click to learn more! We would love to hear #Screen Flow

 

 

2 comments
  1. Ajaypreet Singh Saini (Grantbook) Forum Ambassador
    Aug 14, 2025, 2:43 PM

    Thanks @Bhavin Patel for the shoutout :)

0/9000

I have a date validation on a screen flow Needed_By>TODAY()+13 saying that the needed by date has to be in two weeks.. (there is also a default on the field of exactly two weeks)

 

I have no issue if i leave the default or make the default a later date, but when I make the date sooner, instead of showing the validation error message it gives me a fault:

 

Error element Request_Form (FlowScreen). The "6" value is a Text data type that's assigned to a field with an incompatible Number data type. Assign the value to a field with a compatible data type. #Flow #Screen Flow #Validation Rule

19 answers
  1. Eric Smith (Retired) Forum Ambassador
    Dec 5, 2023, 6:22 PM

    @Raquel Riemer Yes, I am aware of this issue and it has been resolved in v1.0.1 which is available in v3.2.5 of the FlowScreenComponentsBasePack.

    https://unofficialsf.com/flow-action-and-screen-component-basepacks/

0/9000

Dear all, 

 

We are testing and debugging a "Data Capture Flow" but no details are displayed in the "Debug details" panel. 

 

Do you have any idea why ? 

 

Regards, 

 

Aur Fr  

 

#Screen Flow, #Salesforce Field Service

5 answers
0/9000

 

[▶️]🔴🔥🎬 New Salesforce Summer 25 Flow Features You Need To See! 

 

In this video, I am sharing all the new Flow enhancements that came up with Summer 25 release. 

 

In this video, I have covered: 

🌟 - Create Flow New User Interface 

🌟 - Improve Article Navigation with Table of Contents 

🌟 - Control Over Component and Field Layout 

🌟 - Add Icons to Choice Resources and Visual Picker 

🌟 - Automatically Triggered Screen Actions 

🌟 - Add Fault Path in Flow 

🌟 - Enhanced Debug Log 

🌟 - Enhanced Email Action 

 

https://youtu.be/PankQiUAi6w

 

 

@The Blog Group @* Release Readiness Trailblazers *[▶️]🔴🔥🎬 New Salesforce Summer 25 Flow Features You Need To See! In this video, I am sharing all the new Flow enhancements that came up with Summer 25 release.

 

 

 

#Salesforce Developer  #Flow  #Salesforce Admin  #Saleforce Administrator  #Screen Flow  #Flownatics  #Scheduled Flow  #New Releases 

0/9000