Knowledge Drop

Having Default Label Value that's Based off a Parameter


Userlevel 4

Last tested: Mar 10, 2020
 

If we're having our label for a field be based off a parameter value, sometimes we might want to have our Label have a Value that's set in the Field Picker that's different from the parameter's actual value. In order to accomplish this, we can use "field._in_query" to have this behavior here. The code will look something like this:

label: "{% if view_name.parameter_name._in_query %}

{% parameter parameter_name %}

{% else %}

Default value that Loads in Field Picker

{% endif %}

 

This way, Default value that Loads in Field Picker, will be the label of the field when it loads in the Field Picker but when the parameter is selected, the label in the visualization will be set as the parameter's value.

Note that only the label in the visualization will change dynamically with the parameter. It is not possible to have the label in the Field Picker or the results table in the Data section change dynamically when you adjust the parameter value.

 

This content is subject to limited support.                

 

 


0 replies

Be the first to reply!

Reply