Skip to main content

Add Variables and Filters to Topics and Actions

Enable Einstein and Agentforce

Linda’s first step toward setting up user authentication for Cloud Kicks is to make sure both Einstein and Agentforce are enabled. Here is the process.

  1. Click setup icon and select Setup. The Setup page opens in a new tab.
  2. In the Setup Quick Find, search for and select Einstein Setup.
  3. Click the Turn on Einstein toggle, and make sure Einstein is set to On.
  4. Refresh your browser to reload Setup.
  5. In the Setup Quick Find, search for and select Agentforce Agents.
  6. At the top of the Agents page, click the Agentforce toggle, and ensure it is set to On.

Agentforce toggle set to On.

  1. Click the Enable the Agentforce (Default) Agent toggle, and ensure it is set to On.

Enable the Agentforce Agent toggle set to On.

  1. Ensure both toggles on the Agentforce Agents setup page are turned on.

Activate Flows

Next up, Linda activates some pre-created flows in the org. These must be activated for the authentication actions to work properly. Here’s how.

  1. In the Setup Quick Find, search for and select Flows.
  2. Click the Last Modified column heading (last column) to sort the most recently modified flows to the top.
  3. Select the Get Orders by Contact flow to open this flow in a new tab.
  4. Click Activate.
  5. Close this web browser tab. The previous setup tab should still be open.
  6. Select the Get Contact flow (should be the 9th or 10th in the list) to open this flow in a new tab.
  7. Click Activate.
  8. Close this web browser tab. The previous setup tab should still be open.

Modify a Topic and Actions

The Customer Verification topic is a standard topic that verifies the customer’s identity before granting access to sensitive data. This topic contains two actions.

Action

What It Does

Send Email with Verification Code

Sends an email with a one-time verification code that’s valid for 5 minutes. It then asks the user to check their email and provide the code.

Verify Customer

Asks the user for their username or email and checks against Salesforce user and contact records.

Step one is mapping the outputs of the Send Email Verification Code action to the inputs of the Verify Customer action. Consider this a method to link the questions (input) with the answers (output) for both actions.

  1. From Setup, search for and select Agentforce Agents.
  2. Click Cloud Kicks Service Agent.
  3. Click Open in Builder.
  4. In the Topics section, click Customer Verification.
  5. Click This Topic’s Actions tab.
  6. Click Send Email with Verification Code action.

actions from the Customer Verification topic.

Adjust the Outputs

  1. Scroll down and find the output (green) box labeled as 3 Authentication Key Instructions.
  2. Within that box, click in the Map to Variable input.

Map to Variable section highlighted in the Verification Key Output.

  1. Select + New Custom Variable and enter these details.
    • Ensure Name is Authentication Key
    • Ensure API Name is authenticationKey
    • Description: This variable stores the authentication key that generates the verification code.
    • Ensure Data Type is Text
    • Allow value to be set by API: leave unchecked
    • Allow LLM to use value: leave unchecked
  2. Click Save.
  3. Scroll down to the 4 Customer ID Instructions output (green) box and click in the Map to Variable input.
  4. Select + New Custom Variable.
  5. Enter these details.
    • Ensure Name is Customer ID
    • Ensure API Name is customerId
    • Description: This variable stores the user ID or contact ID.
    • Ensure Data Type is Text
    • Allow value to be set by API: leave unchecked
    • Allow LLM to use value: leave unchecked
  6. Click Save.
  7. Scroll down to the 5 Customer Type Instructions output (green) box and click in the Map to Variable input.
  8. Select + New Custom Variable and enter these details.
    • Ensure Name is Customer Type
    • Ensure API Name is customerType
    • Description: This variable stores the customer ID type (user or contact).
    • Ensure Data Type is Text
    • Allow value to be set by API: leave unchecked
    • Allow LLM to use value: leave unchecked
  9. Click Save.

Completed Authentication Key, Customer ID, and Customer Type Outputs with Mapped Variables.

  1. Click <— View Action to return to the list of actions associated with the Customer Verification topic.

Adjust the Inputs

  1. Click Verify Customer action.
  2. Scroll down to the 1 Authentication Key Instructions input (blue) box.
  3. Within that box, click in the Assign to Variable input.
  4. Select the Authentication Key variable.
  5. Scroll down to the 3 Customer ID Instructions input (blue) box.
  6. Within that box, click in the Assign to Variable input.
  7. Select the Customer ID variable.
  8. Scroll down to the 4 Customer Type Instructions input (blue) box.
  9. Within that box, click in the Assign to Variable input.
  10. Select the Customer Type variable.

Corresponding variables added to each Input.

Map the Verify Customer Action with Variables

The next step is to map the Verified and Customer ID outputs of the Verify Customer action with variables. This is a way to connect the verification status with the customer. You can then use these variables in filters for actions you want agents to make on behalf of customers.

  1. With the Verify Customer action still open, scroll up to the 1 Verified Instructions output (green) box.
  2. Within that box, click in the Map to Variable input.
  3. Select + New Custom Variable.
  4. Enter these details.
    • Ensure Name is Verified
    • Ensure API Name is isVerified
    • Description: This variable stores a boolean value that indicates if the customer is verified.
    • Ensure Data Type is Boolean
    • Allow value to be set by API: Leave unchecked
    • Allow LLM to use value: Leave unchecked
  5. Click Save.
  6. Scroll down to the 2 Customer Id Instructions output (green) box.
  7. Within that box, click in the Map to Variable input.
  8. Select the VerifiedCustomerId variable.

Corresponding variables added to each Output.

Create a Filter

This is where the fun really begins! You can now create a filter using the Is Verified variable so agents have access to topic(s) containing private actions only when the customer is verified. Recall that Cloud Kicks wants the Case Management topic to require verification, so that’s where the filter needs to be added.

  1. From the Sidebar, select the Context icon.

Context menu in Agentforce Builder.

  1. From the context panel, click the Filters tab.
  2. Click New and enter these details.
    • Name: Is Verified
    • Ensure API Name is Is_Verified
    • Select All Conditions Are Met (AND)
    • Resource: Verified
    • Operator: Equal
    • Value: True
  3. Click Save.
  4. Click the Topics icon.
  5. Click the <— View Action and then click the < Topic Details to return to the list of topics.
  6. From the list of topics, click Case Management.
  7. Click the filter icon.

Topic Filter icon highlighted.

  1. Click in the Assign Filters input and select Is Verified.
  2. Click Save.

Now that you activated flows, created variables, and applied filters, it’s time to put it all together and see ‌agent authentication in action.

Resources

Compartilhe seu feedback do Trailhead usando a Ajuda do Salesforce.

Queremos saber sobre sua experiência com o Trailhead. Agora você pode acessar o novo formulário de feedback, a qualquer momento, no site Ajuda do Salesforce.

Saiba mais Continue compartilhando feedback