View the original community article here
Last tested: Oct 21, 2020
Looker has an article about cool ways to use Liquid when labeling, but if you use Liquid in a view_label
in one location, say for a field, but use a static string for view_label
in another location, like the explore, you will see duplicate view labels in the field picker. ex: Liquid with view_label
in view:
Static view_label
in explore:
Result in Field Picker:
WHAT IS HAPPENING
The line breaks that help make the Liquid easier to read actually add spaces into the view_label
, effectively making the labels different. ex: From explore: "My Awesome Name"
From view: "My Awesome Name "
To resolve this, remove any spaces/characters between each the liquid tags where you are defining the view name that you are trying to match. ex:
THE RESULT
Your field picker only has one view label for your custom name!
Note: I left spaces between the {% else %}
and Gobbleydegook
because I wasn't trying to match another view_label
defined else where. If you have other Liquid conditions that need to match other view_labels
, be sure to remove any white spaces between Liquid tags in those cases as well.
This content is subject to limited support.