Issue
In the Segment workspace, when configuring a destination mapping with Liquid syntax, a conditional statement using the is operator (such as {% if properties.field is 'yes' %}) produces unexpected results. Instead of evaluating exact string matches, the logic returns the true output for any non-null text value present in the field.
Product
Twilio Segment
Environment
Segment Console
Cause
In standard Liquid syntax, is is not a valid comparison operator. Because the operator is not recognized, the Liquid parser defaults to evaluating the "truthiness" of the variable itself. In Liquid, any string that is not empty or null is considered true. Therefore, if the user profile has any text value in that trait field, the if statement evaluates to true and outputs the first condition block.
Resolution
To resolve this issue, update the Liquid syntax snippet in your destination mapping to use valid operators based on your desired logic:
Navigate to the destination mapping in the Segment Console where the Liquid syntax is applied.
If your goal is to evaluate an exact string match, replace the
isoperator with the==operator.Example:
{% if properties.field == 'yes' %}
If your goal is to intentionally check if a field has a value (an "is present" check), replace the condition with the
!= blankoperator.Example:
{% if properties.field != blank %}
Save the mapping configuration.
Additional Information
Using the blank identifier in Liquid syntax safely checks for both null values and empty strings, making it the most reliable and stable method for creating "is present" or "is not present" conditional logic without relying on parser error-handling.