Welcome to the WalkMe Help Center

Please login in order to continue:

Work flows better with WalkMe
Work flows better with WalkMe.

Troubleshooting Salesforce Variables

Last Updated March 29, 2021

Background

There are seven predefined Salesforce variables that WalkMe can identify in Salesforce (please note that for Salesforce Classic the WalkMe for Salesforce Package is NOT required for these to be available)

  1. walkme_sf_vars.organizationId 
  2. walkme_sf_vars.organizationName
  3. walkme_sf_vars.profileId
  4. walkme_sf_vars.roleId
  5. walkme_sf_vars.userId
  6. walkme_sf_vars.userLanguage
  7. walkme_sf_vars.userName

Limitations

The following aren't available for use in Salesforce Lightning:

  1. walkme_sf_vars.organizationId
  2. walkme_sf_vars.organizationName

sfVars is not supported in Salesforce Lightning Communities.

NOTE: Do not add any of the 7 predefined options to the custom Salesforce Variable field depicted above. This can result in unexpected behaviors with sfVars. If you are trying to track any of the predefined Salesforce variables in reports, you will want to add them as Analytics Properties

Background and Deployment

  • WalkMe for Salesforce Package (WM4SF): In addition to the setup done by WalkMe, we recommend that you deploy the WalkMe for Salesforce Package. This is MANDATORY for Salesforce Lightning. For Salesforce Classic, this will give the builder the ability to include Custom Salesforce Variables.
Please Note:

The sfVars Visual Force page (vf_WalkMeSfVars) will need to be available for all profiles that need to access WalkMe and the variables.  Additionally, for sfVars to be properly retrieved in Lightning, the setting that is accessed via Setup > Session Settings > Clickjack Protection that reads "Enable clickjack protection for customer Visualforce pages with headers disabled"  needs to stay unchecked, which is its default.

Troubleshooting sfVars

"walkme_sf_vars" is showing undefined...

Check the following for all platforms:

  • Make sure to clear cache and cookies when testing updates or changes.
  • Check for incorrectly formatted custom variables by doing the following:
    • In the Editor > Settings > General > Salesforce Variable section
    • Here you would want to check that the custom variable appears correctly formatted according to this KB
  • Ensure that the proper syntax for the variable is used for example: walkme_sf_vars.profileId NOT WalkMe_Sf_Vars.ProfileID

Salesforce Classic

    • Check that window.__sfdcSessionId is callable from the environment's console.
    • If it returns "Not Defined" then this means the user does not have API permissions. Ask the Salesforce Admin to grant the relevant users API permissions in order to use sfVars
      • You can find this setting in Salesforce by checking Setup > Security Controls > Session Settings > Require HttpOnly. 

Salesforce Lightning

    • First, check that the WM4SF package is deployed as this is a REQUIREMENT for Lightning implementations.
    • Check for any incorrectly formatted custom variables per this KB
    • If you see a console error like below this may mean the user does not have access to the sfVars VisualForce page.
    • Check that the user has access to the WM sfVars Visual Force page. It will need to be available for all profiles that need to access WalkMe and the variable. To do this:
      1. Navigate to Setup 
      2. Search for Visualforce Pages in the Quick Find and navigate to the page
      3. Go to V > vf_WalkMeSfVars and click Security
      4. Add all the Profiles to the Enabled Profiles on the right to enable sfVars for the user profile
    • You can also check to see if there is a "walkme-sf-vars-last-fail" key in Local Storage
    • Check that window.__sfdcSessionId is callable from the environment's console. If it returns "Not Defined" then this means the user does not have API permissions. Ask the Salesforce Administrator to grant the relevant users API permissions in order to use sfVars
    • Check if calling document.cookie contains "sid=####" - if it does not, this most likely means that the customer has HTTPOnly enabled for their sessions. sfVars is unable to work with HTTPOnly because it makes the sid cookie invisible to our code. 
      • You can find this setting in Salesforce by checking Setup > Security Controls > Session Settings > Require HttpOnly. 

Communities:

    • Ensure the WM4SF package is deployed and the latest version.
    • Check that the VisualForce page exists for the Community
    • Make sure users have API enabled in Salesforce

Was this article helpful?

Thanks for your feedback!

Be part of something bigger.

Engage with peers, ask questions, share ideas

Ask the Community
×