Display a Flow on a Page Outside Your Salesforce Org

Learning Objectives

After completing this unit, you’ll be able to:
  • Describe use cases for displaying a flow outside your Salesforce org.
  • List the types of Lightning Community pages.
  • Create a new Lightning Community page and add a flow to it.

For users logging into a Salesforce org, we've got lots of options: Lightning pages, flow actions, and the utility bar. But what if you want to open up access to the flow to folks without a Salesforce license?

Lucky for us, we can add flows to our org's Lightning communities. Putting a flow on a Community page is just as easy as putting a flow on a Lightning page. Here are some examples of flows that are perfect for portals built on Salesforce Communities, whether the portal is geared toward customers, partners, employees, or some other group altogether.

  • Surveys
  • Registration forms
  • Interest forms
  • Quote generators, such as for a car they're selling

Beyond the Basics

If you don't use Salesforce Communities, there is another option, but it requires development skills. You, or your developer, can embed the lightning:flow component in your external app by using Lightning Out. The Aura Component Basics module is a great starting point.

Lightning Community Pages

One of the first tasks for creating a community is selecting the template. Each template comes with a specific set of Community pages. That said, all Community pages fall into one of these categories.

  • My Pages The standard pages that you create. (The object pages that you create appear under Objects.)
  • Template Pages The default pages that come with the community template.
  • Objects The pages of the objects in your community, which include the object’s record detail, list, and related list pages.
  • Generic Record Pages These generic pages are used to display record information for a Salesforce object when custom object pages don’t exist.
  • Login Pages The default login pages that come with the community template.

Add Your Flow to a Lightning Community Page

It takes a lot of planning and know-how to set up a community for users, and you can learn about that by checking out Community Rollout Strategy. But if we don't have a community, we can't exactly show you how to add a flow to one. So let’s breeze through creating a community, and then add a flow. We’ve learned about elements and components used for building flows, but within Experience Builder, Flow is, itself, a component. Read on and you’ll see.

  1. Enable Communities for your Trailhead Playground. (If Communities is already enabled, skip ahead to step 2.)
    1. From Setup, enter Communities in the Quick Find box, then click Communities Settings.
    2. Click Enable communities.
    3. Enter a domain name, make sure it's available, and then save your changes.
  2. Create a community.
    1. You should have been redirected to the All Communities page in Setup. If not, or if you skipped step 1, enter Communities in the Quick Find box, and select All Communities.
    2. Click New Community.
    3. Select the Customer Service template, then click Get Started.
    4. Enter a name for the community and click Create.
  3. Now that we've built a fresh community, let's add our flow to its home page.
    1. From the My Workspaces page, click Builder to open Experience Builder.
    2. In the top-left corner, click Components to open the Components pane. Components menu expanded in top-left corner of Experience Builder.
    3. Search for Flow to find the right component. Drag Flow onto the community page. Dragging a Flow component onto a community's home page
    4. Make sure that the component displays the right flow. In the properties pane for Flow, select Sample Flow. Setting properties for a Flow component in Experience Builder

Test Your Flow

All done! Let's see how the flow works in a real live community.

  1. In the top-right corner of the Experience Builder, click Publish. If this is the first time you're publishing this community, it'll take a few minutes. While you wait for the confirmation email, why not grab a cup of coffee?
    Normally, you'd preview the community before you publish it, but the Flow component doesn't display the flow in design or preview mode. That’s a fail-safe to prevent the flow from performing an action (like creating a bunch of records) before the first screen.
  2. In the “Site Published Successfully” confirmation email, click the link.
  3. If you aren't logged in, under the login fields, click Are you an employee? Login here. If you need to enter the username and password for your Trailhead Playground, check out the Get Your Trailhead Playground Username and Password unit of the Trailhead Playground Management module, which shows you how to find them.

That's it! Your flow is now live, and available to community users.

Sample Flow running in a published community.


Keep learning for
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities