Smartech

Understanding the operators for segment creation

This guide will help you understand various operator conditions available while creating client-side segments on the Hansel dashboard.

📘

To know more about client-side segments, click here

Event property and user attribute operators

Below operators will help you craft a condition for your event payload properties or user attributes.

This is available when you set the trigger condition for your nudges or create the client-side segment on Hansel dashboard.

Operators for string data type:

  • Contains - Use this if you have a condition such as selected event property contains the specified value.
  • Does not contain - Use this if you have a condition such as selected event property does not contain the specified value.
  • equal - Use this if you have a condition such as selected event property is equal to the specified value.
  • not equal - Use this if you have a condition such as selected event property is not equal to the specified value.
  • in - Use this if you have a condition such as selected event property falls in the set of specified strings.
  • not in - Use this if you have a condition such as selected event property does not fall in the set of specified value.
  • regex - Use this if you have a condition such as selected event property should match the specific regex. E.g. A condition that would check whether the “email” in the incoming request ends with “gmail” - can be added by adding regex such as .*gmail$. To know more about regex pattern that you can use, click here .

Operators for integer data type:

  • Equal - Use this if you have a condition such as selected event property is equal to the specified value.
  • Greater - Use this if you have a condition such as selected event property is greater than the specified value.
  • Greater or equal - Use this if you have a condition such as selected event property is greater than or equal to the specified value
  • In - Use this if you have a condition such as selected event property falls in the set of specified values.
  • Less - Use this if you have a condition such as selected event property is less than the specified value.
  • Less or equal - Use this if you have a condition such as selected event property is less than or equal to the specified value.
  • Not equal - Use this if you have a condition such as selected event property is not equal to the specified value.
  • Not in - Use this if you have a condition such as selected event property does not fall in the set of specified values.
  • Not set - Use this if you have a condition such as selected event property value is not set.
  • Set - Use this if you have a condition such as selected event property value is set.

Operators for date data type:

  • date equal - Use this if you have a condition such as selected event property equals the specified date selected from the date picker.
  • date post - Use this if you have a condition such as selected event property is after the specified date selected from the date picker.
  • date prior - Use this if you have a condition such as selected event property is before the specified value selected from the date picker.
  • equal - Use this if you have a condition such as selected event property is equal to the specified date in epoch time format.
  • greater - Use this if you have a condition such as selected event property is greater than the specified date in epoch time format.
  • greater or equal - Use this if you have a condition such as selected event property is greater than or equal to the specified date value in epoch time format.
  • in - Use this if you have a condition such as selected event property falls in the set of specified dates in epoch time format.
  • less - Use this if you have a condition such as selected event property is less than the specified date in epoch time format.
  • less or equal - Use this if you have a condition such as selected event property less than equal to the specified date in epoch time format.
  • not equal - Use this if you have a condition such as selected event property is not equal to the specified date in epoch time format.
  • not in - Use this if you have a condition such as selected event property does not fall in the set of specified dates in epoch time format.

Special operators for versions such as SDK version, App version, OS version etc.

  • version equal - Use this if you have a condition of SDK version being equal to the specified version.
  • version greater or equal - Use this if you have a condition of SDK version being greater than or equal to the specified version.
  • version greater than - Use this if you have a condition of SDK version being greater than the specified version.
  • version less or equal - Use this if you have a condition of SDK version being less than or equal to the specified version.
  • version less than - Use this if you have a condition of SDK version being less than the specified version.
  • version not equal - Use this if you have a condition of SDK version being not equal to the specified version.

Please note that a valid version number consists of two or three dot-separated numeric components. The following are valid version numbers:

0.4
0.4.1
0.5
0.9.6
1.0
1.0.4

The following are examples of invalid version numbers:

 1
 2.7.2.2
 1.3.a4
 1.3pl1
 1.3c4

Updated about a month ago



Understanding the operators for segment creation


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.