Salesforce Variables

Last Updated September 15, 2023

Within WalkMe for Salesforce, you can use Salesforce Variables to segment the WalkMe assets you build to ensure that only content relevant to that user type is visible. Variables can also be used to create Analytics reports about individual users based on their email or username to show their usage of WalkMe.

Enabled Feature

Salesforce Variables is an Enabled Feature available to our Salesforce Users. For access, contact your Customer Success Manager or contact Support.

Note: Uploading the Salesforce package is a mandatory process for all Salesforce Lightning implementations, including OOTB (out of the box) variables. The Salesforce package is not supported on Lightning Communities. Please refer to the following article: How to Install the Salesforce Package 

The Short Version

A variable is a value that can change depending on conditions or on information passed to the program through the browser. Salesforce provides a number of default Variables that can be read and used by WalkMe in the Segmentation Center and Analytics. If there are variables you would like to use that are not enabled by default, speak to your Salesforce admin about adding them.

Use Salesforce Variables in the Segmentation Center to target specific users and present them with only relevant items. For example, if some ShoutOuts only apply to users in certain job roles, you can segment it by the role variable. For processes that are only relevant for users in North America, use the region variable.

Salesforce Variables can also be used in User Tracking to identify users. Use a variable that tracks email, ID, or even name. With User Tracking enabled, you will get a more accurate user count in your reports and put individual user actions in context. For example, pull reports on individuals who have completed their Onboarding tasks or have not.

How It Works

To identify a Salesforce Variable, WalkMe will look into the HTML on the end user’s Salesforce instance and pull the value. Salesforce Variables are checked against the value defined in the Segmentation Rule or user tracking settings. Salesforce Variables vary by user. Each variable value is represented as an 18 digit code and will change based on the person currently using the environment.

Salesforce has a number of default variables available within their system. To use the default variables within Salesforce, the Variable name must start with “walkme_sf_vars.” Add the Variable name after the period to use the variable within the Rule Engine. These WalkMe can read and Segment by using the 18 digit version of the Variable value. In some cases, Salesforce will supply a 15 digit version. You can learn how to convert Variable Values from 15 digits to 18 digits in our Salesforce course, linked at the bottom of this article.

Track Individual Users: Unique User Settings

Configure Unique User Settings to identify how you would like to identify users in WalkMe Analytics. By tracking an individual user you can associate engagement data with unique IDs. Tracking unique users, you will get a more accurate user count in your reports and put individual user actions in context. Unique User Settings are found in WalkMe Settings in the General tab. There are a few ways to track individual users. Only one option can be chosen at a time. We recommend tracking by username (walkme_sf_vars.userName), which is typically the user’s email.

Methods For Tracking Users

  • Use User Name (recommended): Use the Variable Identifier and input the WalkMe Salesforce username variable (UserContext.userName):
  • By Email or other variable: If the user name is not the same as the user’s email, you will first need to add it to your Salesforce instance as it is not one of the seven predefined Salesforce Variables. After add it in Salesforce Variable, you can use it as the variable by which to track unique users

Track Different User Types: Global Segmentation

Use Variables in the rules in the Segmentation Center to target specific audiences. For example, if you have different Walk-Thrus for admins and managers, create segments for each role type and define the segment by variable walkme_sf_vars.roleId is manager or admin. There are seven default sfvars available in WalkMe. Use the default 7 in your segmentation rules without having to add them to your general settings.

Default Variables Available in Salesforce

Once sfVars is enabled for you by your Account Manager, the following variables can be used for segmentation:

  • walkme_sf_vars.organizationId
  • walkme_sf_vars.organizationName
  • walkme_sf_vars.profileId
  • walkme_sf_vars.roleId
  • walkme_sf_vars.userId
  • walkme_sf_vars.userLanguage
  • walkme_sf_vars.userName
Please note:

The following variables are not available for use in Salesforce Lightning:



Finding the Current Variable Value

  1. Open the Salesforce account of someone you know has the value you are looking for (i.e. someone on the sales team)
  2. Enter full preview mode in the Editor
  3. Open the console by right clicking on the screen and selecting “Inspect”
  4. Type “walkme_sf_vars” into the console
  5. Press enter to see default variables in Salesforce
  6. If looking for the profile variable, search walkme_sf_vars.profileId and you will see the value for that account (i.e. sales)
  7. If Salesforce returns a 15 digit variable, use a 15 to 18 converter such as this one

Using a Default Variable In The Segmentation Center

  1. Create a New Segment in the Segmentation Center
  2. Click Define This Segment in the Rule Engine, select User Data, then Variable as Rule Type
  3. Type in the prefix “walkme_sf_vars.”
  4. Choose an operator such as “Is” or “Is Not”
  5. Enter the Variable Value

Adding Additional Salesforce Variables

Salesforce exposes only the seven by default and will not look for any extra ones (i.e company, geography, etc) in the HTML unless told and added within the General Settings.If you would like to track a variable that is not one of the default, you will need to have your admin add it to your site and add the variable name it in the Salesforce Variables field located in the General Tab in Settings. To use variables in a rule, use the prefix “walkme_sf_vars.”

In the example below, a customer added an email variable to their environment and is using it for Unique User Tracking (Note: Adding a variable is entirely separate from Unique User Tracking and will not affect it).

How to Add Additional Salesforce Variables

  1. The variables in Salesforce’s setup page are referred to as Fields, and can be found in their Salesforce site’s Setup page by going here: Setup > Objects and Fields > Object Manager > User > Fields & Relationships There are two types of these Fields:
    • If you want to add a variable under the User Custom Fields section, we will need its API name, which should end in “__c“:
      • In this image, to add the BehPwd variable, you would need to type ts2__BehPwd__c into the Salesforce Variable field.
      • After adding the API name to the Salesforce Variable field, the custom variable will need to written as walkme_sf_vars.ts2__BehPwd__c when configuring it as a variable rule in the Rule Engine (note the case sensitivity). This applies to all Salesforce user variables.
    • If you want to add a variable under the User Standard Fields section, we will need its Field Name

      • In this image, to add the About Me variable, you would need to type AboutMe into the Salesforce Variable field.

If the field type is a “Lookup” type, it cannot be added without development work.

Was this article helpful?

Thanks for your feedback!

Select account type

< Back

Mobile account login

< Back