Tableau Extensions API
    Preparing search index...

    Interface CategoricalFilter

    A Categorical Filter

    interface CategoricalFilter {
        appliedValues: DataValue[];
        fieldId: string;
        fieldName: string;
        filterType: FilterType;
        isAllSelected?: boolean;
        isExcludeMode: boolean;
        worksheetName: string;
        getAppliedWorksheetsAsync(): Promise<string[]>;
        getDomainAsync(domainType?: FilterDomainType): Promise<CategoricalDomain>;
        getFieldAsync(): Promise<Field>;
        setAppliedWorksheetsAsync(applyToWorksheets: string[]): Promise<string[]>;
    }

    Hierarchy (View Summary)

    Index

    Properties

    appliedValues: DataValue[]

    A list of values applied to this categorical filter. Notice that if this is a dependent filter, the current relavent values can be fetched by calling getDomainAsync(tableau.FilterDomainType.Relevant).

    fieldId: string

    The id of the field being filtered.

    fieldName: string

    The name of the field being filtered. Note that this is the caption as shown in the UI, and not the actual database field name.

    filterType: FilterType

    The type of the filter.

    isAllSelected?: boolean

    True if all the values are selected for this filter. When 'All' is selected, appliedValues returns an empty list.

    This field is available in Tableau 2019.2 or later

    isExcludeMode: boolean

    True if this filter is an exclude filter, false if an include filter.

    worksheetName: string

    The parent worksheet.

    Methods

    • Returns Promise<string[]>

      the list of worksheet names that have the filter applied.

      1.9.0 and Tableau 2022.2

    • Parameters

      Returns Promise<CategoricalDomain>

      a promise containing the categorical domain for the filter. Note if a filter contains multiple fields (such as a filter action with multiple fields), the values array in the returned CategoricalDomain (CategoricalDomain.values) will be empty. If there are multiple fields in the filter, the results need to be represented by a table, which is not currently supported.

    • Returns Promise<Field>

      a promise containing the field for the filter.

      1.5.0 Fixed to properly return the field. Also requires Tableau 2019.2+.

    • Applies the filter to the specified list of worksheets. If the worksheet(s) do not exist or do not contain the field in their data sources, an exception is thrown.

      Parameters

      • applyToWorksheets: string[]

        list of worksheets to apply the filter on

      Returns Promise<string[]>

      the list of worksheet names that have the filter applied

      1.9.0 and Tableau 2022.2