You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d773ebc
Browse filesBrowse the repository at this point in the historyBrowse files
Remove the operator and field scope claims, the case-sensitivity paragraph, the like operator table, the view filter section, the In list section and the version-specific encoding and wildcard claims. Keep the comma failure, the asterisk workaround, and the Has and CaseInsensitiveEquals operator rows.
Co-Authored-By: Claude Code <noreply@anthropic.com>
From REST API 3.7, an ampersand (`&`) works when you use TSC, because TSC URL-encodes the query
74
-
string. On earlier versions, or if you build the request yourself, encode the ampersand as `%26`:
75
-
a literal `&` ends the `filter` parameter and the server sees a truncated filter.
73
+
An ampersand (`&`) in a name is matched as typed.
76
74
77
75
To find an item whose name contains a comma, replace the comma with an asterisk (`*`). The
78
76
asterisk acts as a wildcard, so the following filter finds the workbook named
@@ -83,7 +81,7 @@ for workbook in server.workbooks.filter(name="Sales* Q1 & Q2"):
83
81
print(workbook.name, workbook.id)
84
82
```
85
83
86
-
Because a wildcard matches any character, the filter can return more than one item. Check
84
+
Because `*`matches any run of characters, the filter can return more than one item. Check
87
85
the results on the client side if you need an exact match:
88
86
89
87
```py
@@ -96,50 +94,10 @@ This works because `Equals` treats `*` as a wildcard (see [Wildcard searches](#w
96
94
97
95
### Wildcard searches
98
96
99
-
The REST API supports wildcard searches (starts with, ends with, and contains) starting in
100
-
Tableau Cloud May 2023 and Tableau Server 2022.1.14. The REST API documents these searches
101
-
through its `like` operator, and only on selected name fields: user name, user
102
-
friendlyName, group name, and group set name. Other fields support exact matches only.
103
-
104
-
In practice, `*` also acts as a wildcard in the value of an `Equals` filter on other name
105
-
fields, at the start, end, or middle of the value. In testing this worked for workbook names on
106
-
Tableau Cloud and for project names on a Tableau Server that supports REST API 3.31. For example,
107
-
`server.workbooks.filter(name="Sales*")` returns workbooks whose names start with `Sales`,
108
-
`name="*2026"` returns names that end with `2026`, and `name="*Q1 *"` returns names that contain
109
-
`Q1 `. The match ignores letter case where `Equals` does. The REST API
110
-
documentation does not describe this behavior or say which versions support it, so confirm it on
111
-
your Tableau Server version and field before you rely on it. The
112
-
`like` operator is rejected on workbook names (`400 Bad Request`), as are `CaseInsensitiveEquals`
113
-
and `Has`.
114
-
115
-
For example, to search for the string `marketing-example`, the REST API documentation
116
-
gives the following filter expressions:
117
-
118
-
| Search | REST API filter expression |
119
-
| --- | --- |
120
-
| Starts with |`name:like:mark*`|
121
-
| Ends with |`name:like:*-ample`|
122
-
| Contains |`name:like:mark*ex*`|
123
-
124
-
TSC does not define a `RequestOptions.Operator` value for `like`, and there are no
125
-
`contains`, `startswith`, or `endswith` operators. A Django style filter such as
126
-
`name__like="mark*"` raises a `ValueError`.
127
-
128
-
### View filters follow different rules
129
-
130
-
The rules above apply to the `filter` query parameter that `RequestOptions.filter` and the
131
-
Django style filters build. View filters that you set with `vf()` on export options such as
132
-
`CSVRequestOptions` or `PDFRequestOptions` are sent as `vf_<column>=<value>` parameters, and
133
-
the server reads their values differently:
134
-
135
-
- A comma separates alternatives, so `vf("Region", "East,West")` matches `East` or `West`.
136
-
To match a literal comma, escape it with a backslash: `vf("Name", "Rock\\, Paper")`.
137
-
-`*` and `%` are literal characters, not wildcards.
138
-
- Ampersands and other characters are passed through as data. TSC URL-encodes the value, so
139
-
`vf("Client", "Smith & Sons")` sends the ampersand intact.
140
-
141
-
For the server-side rules, see [Filter query views](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_filtering_and_sorting.htm#Filter-query-views)
142
-
in the REST API documentation.
97
+
In a filter value, `*` matches any run of characters, including none. For example,
98
+
`server.workbooks.filter(name="Sales*")` returns workbooks whose names start with `Sales`. This
99
+
was tested for workbook names on Tableau Cloud. Confirm the behavior on your Tableau Server
0 commit comments