Leverage User Attribute Functions (UAF) with Tableau Lightning Web Components

You can leverage User Attribute Functions (UAF) with your Tableau View and Pulse Lightning web components (LWC) to surface specific data based on the attributes of the user looking at a visualization. User attribute functions provide row-level security so that people viewing your visualization only see data relevant to them. For more information about UAFs, see Unlock the Power of Personalized Analytics with User Attribute Functions.

Prerequisites

Tableau UAF Claims Definitions in Salesforce

Tableau UAF definitions allow you to include claims for user attributes in the JWT. The values for these attributes can be pulled from Account or User objects in Salesforce. When used in conjunction with user attribute functions in Tableau content, only data matching the specified attributes is displayed.

For example, a Tableau dashboard may be configured to only show sales data where the value in its [State/Province] data column matches one of the values in the JWT claim for the attribute 'state'.

Syntax: USERATTRIBUTEINCLUDES('attribute_name', expected value)

Example: USERATTRIBUTEINCLUDES('state', [State/Province])

Creating a claim definition in Salesforce can include the appropriate user-specific information in the JWT. In this example, the attribute 'state' may be populated with values from Accounts where the current user is the Account Owner by pulling values from the Billing State/Province field.

Example Claim Definition

  • Definition Name: state_Account_BillingState

  • Attribute Name: state

  • Target Object: Account

  • Target Object Field: Billing State/Province

  • Viewer Target Object Relationship: Current Viewer is the Account Owner

In the case of a sales representative who owns accounts in Washington, Oregon, and California, the JWT will include a claim for 'state' with the values [WA, OR, CA]. The Tableau dashboard would then only show data with [State/Province] values matching WA, OR, or CA.

Create a definition

To create a user attribute definition, follow these steps:

  1. From your Salesforce app, select the gear in the top-right corner, and then select Setup.

  2. On the left navigation pane, enter “Tableau” in the Quick Find search bar.

  3. Select the Tableau UAF Claims Definition settings page.

  4. Select Create New.

  5. Fill in the definition values:

    1. Definition Name: Enter a unique name. (Example: state_Account_BillingState)

    2. Attribute Name: Enter the attribute name specified by the user attribute function in Tableau. (Example: state)

    3. Target Object: Select the target object is where you want to pull the information from. Tableau LWCs currently support the objects Users and Accounts.

    4. Target Object Field: Select the field that you want to pull the information from. (Example: Billing State/Province)

    5. Viewer Target Object Relationship: Select the relationship between the current viewer and the Target Object. (Example: Current Viewer is the Account Owner).

  6. Select Save. Or, if you want to return to the Tableau UAF Claims Definition settings page without saving, select Cancel.

Add a definition to a Tableau Lightning web component page

When you configure a Tableau LWC, use the UAF Definition Names component field to select the UAF claim definitions that you want to add.

To add a definition:

  1. Select Select….

  2. Use the arrows to move available definitions to the Selected field.

  3. Select OK.

Experience Cloud pages

Enter a comma-separated list of UAF claim definition names. To copy definition names, from the Salesforce app, navigate to the Tableau UAF Claims Definition setup page, and select Copy.

Delete a definition

To delete a user attribute definition, follow these steps:

  1. From your Salesforce app, select the gear in the top-right corner, and then select Setup.

  2. On the left navigation pane, enter “Tableau” in the Quick Find search bar.

  3. Select the Tableau UAF Claims Definition settings page.

  4. Select Delete for the definition that you want to delete.

App, Home, and Record pages

If you delete a definition that is already added to a Tableau LWC, refresh the page in Lightning App Builder to update the available definitions. Deleted definitions are automatically removed.

Experience Cloud pages

Deleted definitions are not automatically removed from the Tableau LWC component field. Deleted definitions in the UAF Definition Names component field won’t cause problems, but do create unnecessary and confusing clutter. To remove definitions from the Tableau LWC component field, select the UAF Definition Names field, and manually delete any names that are no longer in use.