This is inside a community with a flow in a lightning cmp.

I have a flow with sublfows going down 4 child levels. If a page is refreshed, it refreshes it from the very first flow as if the page was accessed freshly. So it's possible for users to create duplicate records because they simply refreshed the page.

How can I handle a page refresh to go to the home page?


<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,forceCommunity:availableForAllPageTypes,force:hasSObjectName" access="global"  >
<!-- Uses Design component to grab 'courseId' out of the URL. -->
<aura:attribute name="courseId" type="String" default="this is default value"/>
<aura:attribute name="contactId" type="String" default="this is default value"/>
<aura:attribute name="crsname" type="String" default="this is default value"/>
<aura:handler name="init" value="{!this}" action="{!c.init}" />

<lightning:card iconName="standard:article" title="{!v.crsname}">
    <lightning:flow aura:id="flowData" />


init : function (component) {

    // Find the component whose aura:id is "flowData"
    var flow = component.find("flowData");
    // In that component, start your flow. Reference the flow's Unique Name.
    var inputVariables = [
              name : 'Course_Id',
              type : 'String',
              value : component.get("v.courseId")


    flow.startFlow("Course_Application", inputVariables);


courseName : function(component, design) {



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.