Oct 26, 2021
Advanced use of the Tableau Viz LWC component – Integration, Authentication, and Tableau Viz LWC
The first and most important advanced use of the Tableau Viz LWC component is to add filtering. The Tableau Lightning Web Component enables two filtering techniques for Tableau visualization, which are exclusively applicable to Lightning record pages and not to Home or App pages. These approaches encompass context filtering, contingent upon the page embedding the visualization, and advanced filtering, which entails specifying corresponding fields in Tableau and Salesforce for more intricate filtering.
You can filter the component to the context of the current page by following the steps below:
- To implement context filtering, the Tableau visualization necessitates a field corresponding to the record page ID. For instance, to display a sales visualization pertaining to a specific user on their page, the Tableau visualization should encompass a field containing user record IDs.
- Within your Salesforce organization, choose a record page to embed the visualization (for example, Users or Opportunities).
- Modify the record page and configure the component by inputting the Tableau visualization URL containing the desired data. The visualization must include a field containing record IDs (for example, user or account IDs).
- Opt for filtering the Tableau view based on the current Salesforce record and save the alterations to the page.
- The component applies the filter when the record page ID matches the corresponding field value in the Tableau visualization, such as displaying only the sales data pertinent to the user on their page.