KNOWLEDGE BASE

Cannot Filter View Using Secondary Data Source Filter Using Javascript API


Published: 17 Nov 2020
Last Modified Date: 18 Nov 2020

Issue

Cannot filter view using secondary data source filter using JavaScript API.

Environment

  • Tableau Server
  • Javascript API

Resolution

Try the below steps:

1. Make sure that at least one field from the secondary data source is used on the view that is being filtered to activate the blend
2. You cannot filter the Viz before loading the visualization. You can only Apply Filters After Loading the Visualization with secondary data source filters
3. Make sure the syntax is [DS_Name].[Field_Name]. The syntax would be like following: 
     worksheet.applyFilterAsync('[DataSource_Name].[Field_Name]', 'Value_to_filter',tableau.FilterUpdateType.REPLACE);
 

Cause

1. Viz cannot be filtered with secondary data source filter before loading the visualization so using "[DS_Name].[Field_Name]":"Value_to_filter" in the Options will not work
2. The blend is not activated meaning a field from secondary DS is not used in the view
3. The syntax for calling secondary data source field is not correctly used
 
Did this article resolve the issue?