- Print
Learn how to change your data types using the Expression Editor.
Typecasting is the method to convert data types into a different data type, in order to use the data in different methods or contexts. You can typecast data in Tulip using the Expression Editor in a Trigger.
Converting Text
texttoboolean()
Parses text into a Boolean. “y”, “yes”, “t”, “true”, and “on” (and any capitalized variants) are recognized as true, and “n”, “no”, “f”, “false”, and “off” are recognized as false.
In the example below, each text variable on the left converts to a boolean on the right side.
texttodatetime()
Changes a given text data type to a Datetime data type
NOTE: For this expression, you are required to include a timezone in the expression. View this website for a list of supported timezones.
texttofile()
Converts text into a file
texttoimageurl()
Converts text into an Image URL
texttointeger()
Parses text into an Integer
texttonumber()
Parses text or a timestamp into a Number
Converting to Text
datetimetotext()
Changes a given datetime data type to a text data type
filetotext()
Converts a file into text
totext()
Parses anything into text
Other Typecasting Expressions
badge_id_to_user()
Converts a badge ID to a User object
int_to_hex()
Returns the hexadecimal representation of the given number
hex_to_int()
Returns the numeric representation of the given hexadecimal string
interval_to_seconds()
Returns the length of an Interval in seconds
interval_to_seconds()
Returns the length of an interval in seconds
seconds_to_interval()
Converts seconds into an interval
user_id_to_user()
Converts a user ID to a user object
Did you find what you were looking for?
You can also head to community.tulip.co to post your question or see if others have faced a similar question!