Use wildcards in a "Text input" control
“Text input” controls require an exact string match. However, you can set up searching by partial string matches, which lets you use wildcards, for both single-value and multi-value “Text input” controls.
For single-value “Text input” controls
In a visual mode query
Setting up partial string matches for single-value “Text input” controls is similar to the usual setup process. The main difference is you’ll just need to use a different filter operator (either like or not like) when connecting the “Text input” to a query. Learn how to set up a “Text input” control.
When you or other dashboard viewers use the “Text input” on the dashboard, you can now use wildcards in the search terms of your “Text input”.
For example, if you wanted to filter your chart for issue summaries that start with “N”, you’d use the following search term in your “Text input”: N%
In a SQL mode query
When you set up a “Text input” control to use wildcards in a visual mode query, the dashboard viewers are the ones who need to remember to use wildcards when filtering with the “Text input”. If you want to handle wildcards in the background, you can do this in a SQL mode query.
When you reference the “Text input” control in your query, make sure to append .RAW
to your control's name and wrap the search term (including any wildcards) in single quotes.
Here’s a general example of how you’d do this in a WHERE
clause:
WHERE “column_name” LIKE '%{TEXT_INPUT_NAME.RAW}%'
For multi-value “Text input” controls
Setting up partial string matches for multi-value “Text input” controls requires a little more work. Your chart will need a few tweaks to set this up, as lists can only include exact matches and wildcards are not compatible with the “is one of” and “is not one of” filter operators. Additionally, the “like” and “=” operators allow for only one value. You’ll need to edit the SQL directly in SQL mode to accommodate this type of filtering.
Hover over the chart connected to your “Text input” control.
Select More actions then select Edit chart.
Select the query connected to your “Text input” then select the Pencil to edit it.
If the query uses visual mode, select SQL to switch to SQL mode.
Edit the
WHERE
clause with the following format:WHERE "table_name"."column_name" LIKE any (array[{TEXT_INPUT}])
Replace
table_name
andcolumn_name
with the table name and column name of the column whose values you want to filter, andTEXT_INPUT
with the name of your control.Select Run query. If there are no errors, the result table will update with the new filter applied to the data.
Select Save to dashboard to save the chart.
When you or other dashboard viewers use the “Text input” control on the dashboard, you can now use wildcards in the search terms of your “Text input”.
For example, if you’re trying to filter for particular email domains, you can wrap each search term with the %
wildcard. The format will generally look like this: %searchterm%
.
The other SQL wildcard characters should work as well.