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
Single Sign-On (SSO) with Token Authentication is configured for Tableau Lightning Web Components. See Configure Tableau Lightning Web Components and Single Sign-On (SSO) with Token Authentication.
Tableau is configured to capture user attributes in authentication workflows. See Allow capture of user attributes.
Tableau content to be embedded includes user attribute functions. For an example of how to use user attribute functions in a Tableau workbook, see Ensure the content author includes user attribute functions.
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:
From your Salesforce app, select the gear in the top-right corner, and then select Setup.
On the left navigation pane, enter “Tableau” in the Quick Find search bar.
Select the Tableau UAF Claims Definition settings page.
Select Create New.
Fill in the definition values:
Definition Name: Enter a unique name. (Example: state_Account_BillingState)
Attribute Name: Enter the attribute name specified by the user attribute function in Tableau. (Example: state)
Target Object: Select the target object is where you want to pull the information from. Tableau LWCs currently support the objects Users and Accounts.
Target Object Field: Select the field that you want to pull the information from. (Example: Billing State/Province)
Viewer Target Object Relationship: Select the relationship between the current viewer and the Target Object. (Example: Current Viewer is the Account Owner).
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:
Select Select….
Use the arrows to move available definitions to the Selected field.
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:
From your Salesforce app, select the gear in the top-right corner, and then select Setup.
On the left navigation pane, enter “Tableau” in the Quick Find search bar.
Select the Tableau UAF Claims Definition settings page.
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.