Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.
Estimación de tiempo

Build a Screen Flow

Learning Objectives

After completing this unit, you’ll be able to:

  • Build a simple screen flow.
  • Use simple screen components to ask questions.
  • Add guiding information to a flow screen.
Note

This badge is one stop along the way to Flow Builder proficiency. From start to finish, the Build Flows with Flow Builder trail guides you through learning all about Flow Builder. Follow this recommended sequence of badges to build strong process automation skills and become a Flow Builder expert.

Hands-On Challenge

Ready to get hands-on with Flow Builder?

Launch your Trailhead Playground now to follow along and try out the steps in this module. To open your Trailhead Playground, scroll down to the hands-on challenge and click Launch. You also use the playground when it's time to complete the hands-on challenges.

For reference, here are the details for the flow you planned in the previous unit. In this unit, you build the flow.

Screen Element

Case field

Information needed

Screen component to use

Description

Caller’s full, detailed description of the problem

Long text

Subject

Agent’s summary of the problem (for the Case subject)

Short text

Status

Call result: problem solved or not solved

Toggle

Formula: If True, Status = Closed; otherwise Status = New

Create Records Element

Case field

Information needed

Resource to use

Account ID

Account related to the current record

Text variable 

Available for input

Contact ID

The current contact record

Text variable

Available for input

Create a Screen Flow and Add a Screen Element

Let’s start by creating a screen flow and adding a screen to it.

  1. In Flow Builder, create a Screen Flow.
  2. Add a Screen element.
  3. In the Screen Properties pane, for Label, enter Questions.
    This label is shown on the Flow Builder canvas and isn’t shown to users. Users see the flow’s name at the top of the screen.
    The New Screen window's Screen Properties pane corresponding to the preceding steps.

Add Guiding Text

Now it’s time to add some things to the screen. Before we dive into asking questions, let’s provide a script to guide support agents through a conversation with a customer. We want to help the support team say the right things, so start with some guiding text.

  1. Drag Display Text from the Components list to the screen canvas. Alternatively, you can click the component’s name to add it to the end of the screen canvas.
    The Display Text component at the bottom of the Components list and an empty screen canvas.
Note

When you added the Display Text component to the screen, did you notice that the right pane changed? When a component is selected, the properties pane contains info and configuration options for that component. When no component is selected, the properties pane contains info and configuration for the current screen.

  1. For API Name, enter SayThisText.
  2. Below the API name is an unnamed rich text field. That’s where you enter the text that you want to show to your users. Enter:
    (Say this to the caller)
    Thank you for calling Pyroclastic, Inc. We’re sorry you’re having trouble with our products and we want to help you as quickly as possible. Can you please describe the problem you’re having?
  3. Change the formatting of the text so that the font is Salesforce Sans and the size is 14. Change the formatting of the first line to make it bold and bright red, so that it stands out from the rest of the text.
    The Display Text properties pane corresponding to the preceding steps.

Add Questions

Next, let’s add the questions for the support agent to answer.

  1. To give support agents plenty of space to describe the caller’s problem, add a long text component.
    • Drag Long Text Area from the Components list to the screen canvas.
    • For Label, enter Problem Description.
    • In the Long Text Area properties, for API Name, enter ScreenDescription.
      Yes, we're creating a screen component with a label and an API name that don't match. Sometimes it makes sense to create a screen component with a label that's easy for your flow's users to understand, along with an API name that's easy for you and other admins to understand.
    • Click Require to prevent users from completing the flow without answering this question.
      The screen canvas and Toggle properties, showing the ScreenDescription component and its configuration corresponding to the preceding steps.
  1. Add a text question for agents to enter the case subject.
    • Drag Text from the Components list to the screen canvas.
    • In the Text properties, for Label, enter Case Subject.
    • For API Name, enter ScreenSubject.
      We’re giving it a unique name here to prevent confusion later.
    • Click Require.
  1. Add a toggle to close the case as it’s created, if the support agent solved the customer’s problem during the call.
    • Drag Toggle from the Components list to the screen canvas.
    • For API Name, enter CloseCase.
    • For Label, enter Were you able to solve the customer's problem during this call?
    • For Active Label, enter Yes, Solved.
    • For Inactive Label, enter No, Not Solved.
      The screen canvas and Toggle properties, showing the CloseCase component and its configuration corresponding to the preceding steps.
  1. Click Done to close the screen element.

Just like that, you’ve got a screen that asks three questions. 

Use the Answers to Create a Case

So far, you have the Description, Subject, and Status (Solved or Not Solved) entered by the user in the screen element. It’s time to create a formula to change the Toggle’s True or False value to either Closed or New, but there’s a hitch. (Again!) You can’t get the user’s choice from the Toggle itself. You have to reference the Toggle’s value property, like this: 

{!CloseCase.value}

Also, to use the Account ID and Contact ID from the current Contact record, you need a variable that can receive each ID in the flow.

  1. Create a formula resource:
    • API Name: frmStatus
    • Data Type: Text
    • Formula: IF({!CloseCase.value} = TRUE, "Closed", "New")
Note

You might remember that a best practice for formulas is to use them only when you can't get the result you need in any other way. Well, now we're amending that rule. In this case, we could use a Decision element and two Assignment elements, but the formula is much more efficient for this simple use case.

  1. Create a variable to receive the current contact’s ID:
    • API Name: inputContactId
    • Data Type: Text
    • Select Available for input
  1. Create a variable to receive the current contact’s account:
    • API Name: inputAccountId
    • Data Type: Text
    • Select Available for input
  1. After the Screen element, add a Create Records element to create the case:
    • Label: Create Case
    • How to set record field values: Manually
    • Object: Case
    • Set field values:
      • Field: Account ID, Value: inputAccountId
      • Field: Contact ID, Value: inputContactId
      • Field: Description, Value: Questions > Problem Description
      • Field: Status, Value: frmStatus
      • Field: Subject, Value: Questions > Case Subject
  1. Save the flow. For Label, enter Create Case for Contact.

Your Toolbox and flow canvas should look something like this.

The Toolbox and Flow Builder canvas, corresponding to the preceding steps.

Resources

Comparta sus comentarios sobre Trailhead en la Ayuda de Salesforce.

Nos encantaría conocer su experiencia con Trailhead. Ahora puede acceder al nuevo formulario de comentarios cuando quiera desde el sitio de la Ayuda de Salesforce.

Más información Continuar para compartir comentarios