I have a chart that shows data based on a variable $sourcetype_tok$. The values of the dropdown list are as follows:
A list of categories from a query
A static one that has the name all and the value * that should represent all the categories combined
However, the chart's title should depend on the selected category. Until now, I have this:
Top 10: $sourcetype_tok$ domains
If the selected category is A, it works.
However, if I select the value all, the title will be Top 10: * domains and I want it to be customizable. Is there a way I can insert fields such as <title> conditionally? Or can I do something so the title would depend on the value of a token?
This should make your input set a second token display_domain_names which contains the text "Unfiltered" if the user selects the "all" option or the selected value if another one is selected. Use this token in your title. If label and value are different in the dropdown and label is nicer, you also have $label$ available. Docs here.