Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 35 additions & 2 deletions tableauserverclient/server/request_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,42 @@ def get_query_params(self):

def vf(self, name: str, value: str) -> Self:
"""Apply a filter based on a column within the view.
Note that when filtering on a boolean type field, the only valid values are 'true' and 'false'

For more detail see: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_filtering_and_sorting.htm#Filter-query-views
Serialized to the REST API as ``vf_<name>=<value>``. The rules below
describe how the server interprets the wire value; ``vf()`` itself
does not transform your input.

Value syntax
------------
- **Exact match (default):** a single value matches rows where the
column equals that value exactly. Case-sensitivity follows the
underlying data source.
- **OR-list:** commas separate alternatives, so ``"East,West"``
matches rows where the column is ``East`` OR ``West``.
- **Escaping** applies to two characters only, comma and backslash;
all other characters (``&``, ``=``, ``/``, ``#``, ``%``, ``+``,
quotes, brackets, etc.) pass through untouched -- ``vf()`` URL-
encodes them for transport and the server treats them as literal
data. To match a value containing a literal comma, escape it:
``"Rock\\, Paper\\, Scissors"`` matches ``Rock, Paper, Scissors``
(without escaping, the comma starts an OR-list). To match a
literal backslash, double it: ``"C:\\\\temp\\\\file"`` matches
``C:\\temp\\file``. URL-encoding (``%2C``, ``%5C``) does NOT
escape either character.
- **Empty value** (``vf_<name>=``) overrides any workbook-embedded
filter on that column, effectively widening it to all values.
This is undocumented but stable behavior that some users rely on.
- **Wildcards** (``*``) are NOT supported by the REST view-filter
layer. Wildcard matching is a viz-configured behavior on filter
controls inside a workbook; use ``.parameter()`` and design the
workbook accordingly if you need it.
- **Ranges, comparisons, operators** (``>``, ``<=``, ``BETWEEN``,
etc.) are NOT supported. Design the workbook's filters to expose
the shape you need at export time.
- **Booleans:** the only valid values are ``'true'`` and ``'false'``.

For more detail see:
https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_filtering_and_sorting.htm#Filter-query-views

Parameters
----------
Expand Down
Loading