Is there a way to do an "IN" or "contains" function in liquid?

Knowledge Drop

Last tested: Jun 17, 2020
 

Yep!

For example, this liquid will turn the background color of a value red if the value contains "Test":

sql: ${TABLE}.field_name;; html: {% if value contains "Test" %} <p style="color: black; background-color: red; font-weight:bold">{{ rendered_value }}</p> {% else %} {{ rendered_value }} {% endif %} ;;
 

This content is subject to limited support.                

Comments
sukhadj
New Member

@molly_lippsett Where can I find exhaustive list of function that liquid supports?

sukhadj
New Member

@molly_lippsett Thank you!! That was really helpful. Just a follow up question - do you know which liquid version looker uses? I want to use whitespace control but seems like its present with liquid 4.0.0 only

Version history
Last update:
‎06-28-2021 11:51 AM
Updated by: