1

Newbie here!

I've created an admin tools menu, and I've already created the flows required for each tool.

Now that I have the menu I was able to launch said flows in a separate window, but I can not find a way to launch these flows in a modal/pop up window when the user clicks the hyperlink. I've found a lot of things with aura and in labs but its now what i need.

Im doing this at the moment:

 <!-- Change Cost Center Name -->   
<div class="slds-m-top_medium slds-col">
    <div class="slds-p-around_medium lgc-bg">
        <lightning-icon icon-name="custom:custom16" class="slds-align_absolute-center" size="large" ></lightning-icon>
       
        <lightning-tile class="slds-text-align_center slds-m-top_large" label="Cost Center Name Change" size="xx-large" href="/flow/Update_Cost_Center_Name">
            
            <p class="slds-m-top_x-large" title="Description">
                This tools allows you to change a Cost Center name and all of its instances,including the Cost Center in the stories related.
            </p>

        </lightning-tile>
    </div>    
</div>

And its being open in a new window, how can i make it pop up? is it even possible? am I dumb? Thanks!

1
  • In your question you have "using LWC only". Do you really mean "from a lightning record page using LWCs"? i.e. the solution I'm thinking of involves aura and other things, but I think will work for what you're after.
    – Nick C
    Commented Mar 18, 2022 at 2:33

3 Answers 3

2

Currently embedding flows in lightning web components is not possible.

Workaround to use a flow in lightning experience is by using the Aura component, create a popup, and embedding the flow using lightning:flow in the popup.

Check this out - Embed a Flow

0

Flows in LWC components are available since the Winter '23 release: https://developer.salesforce.com/docs/component-library/bundle/lightning-flow/documentation

<template>
 <lightning-flow
    flow-api-name='myFlowAPIname'
    flow-input-variables={inputVariables}
    onstatuschange={handleStatusChange}
 >
 </lightning-flow>
</template>


get inputVariables() {
 return [
    {
        name: 'OpportunityID',
        type: 'String',
        value: '<Opportunity.Id>'
    },
    {
        name: 'AccountID',
        type: 'String',
        value: '<Opportunity.AccountId>'
    }
 ];
}

handleStatusChange(event) {
 if (event.detail.status === 'FINISHED') {
    // set behavior after a finished flow interview
 }
}

For Modals please see: https://developer.salesforce.com/docs/component-library/bundle/lightning-modal/documentation

1
  • Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
    – identigral
    Commented Jan 23 at 17:46
-1

There is a good appexchange product for this, have look at https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000FMYinUAH?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .