---
title: "Typecast expressions"
slug: "typecast-expressions"
updated: 2025-05-30T16:57:03Z
published: 2025-05-30T16:57:03Z
canonical: "support.tulip.co/typecast-expressions"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.tulip.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Typecast expressions

*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.

---

## Convert 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.

![texttoboolean expression](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/texttoboolean%20expression.png)

In the example below, each text variable on the left converts to a boolean on the right side.

![texttoboolean expression in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/texttoboolean%20expression%20in%20app.png)

**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](https://www.php.net/manual/en/timezones.php) for a list of supported timezones.

![texttodatetime expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/texttodatetime%20expression%20ex.png)

![texttodatetime expression ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/texttodatetime%20expression%20ex%20in%20app.png)

**texttofile()** Converts text into a file

![texttofile expressions ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/texttofile%20expressions%20ex.png)

**texttoimageurl()** Converts text into an Image URL

![texttoimageurl expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/texttoimageurl%20expression%20ex.png)

![texttofile and imageurl expression ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/texttofile%20and%20imageurl%20expression%20ex%20in%20app.gif)

**texttointeger()** Parses text into an Integer

![texttointeger expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/texttointeger%20expression%20ex.png)

**texttonumber()** Parses text or a timestamp into a Number

![texttonumber expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/texttonumber%20expression%20ex.png)

## Convert to text

**datetimetotext()** Changes a given datetime data type to a text data type

![datetimetotext expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/datetimetotext%20expression%20ex.png)

![datetimetotext expressions ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/datetimetotext%20expressions%20ex%20in%20app.png)

**filetotext()** Converts a file into text

![filetotext expressions ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/filetotext%20expressions%20ex.png)

![filetotext expression ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/filetotext%20expression%20ex%20in%20app.png)

**totext()** Parses anything into text

## Other Typecasting Expressions

**badge_id_to_user()** Converts a badge ID to a User object

![badge_id_to_user expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/badge_id_to_user%20expression%20ex.png)

![badge_id_to_user expression ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/badge_id_to_user%20expression%20ex%20in%20app.png)

**int_to_hex()** Returns the hexadecimal representation of the given number

![int_to_hex expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/int_to_hex%20expression%20ex.png)

![int_to_hex expression ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/int_to_hex%20expression%20ex%20in%20app.png)

**hex_to_int()** Returns the numeric representation of the given hexadecimal string

![hex_to_int expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/hex_to_int%20expression%20ex.png)

![hex_to_int expression ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/hex_to_int%20expression%20ex%20in%20app.png)

**interval_to_seconds()** Returns the length of an Interval in seconds

![int_to_hex expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/int_to_hex%20expression%20ex.png)

![int_to_hex expression ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/int_to_hex%20expression%20ex%20in%20app.png)

**interval_to_seconds()** Returns the length of an interval in seconds

![interval_to_seconds expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/interval_to_seconds%20expression%20ex.png)

**seconds_to_interval()** Converts seconds into an interval

![seconds_to_interval expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/seconds_to_interval%20expression%20ex.png)

![intervals and seconds expressions ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/intervals%20and%20seconds%20expressions%20ex%20in%20app.gif)

**user_id_to_user()** Converts a user ID to a user object

![user_id_to_user expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/user_id_to_user%20expression%20ex.png)

![user_id_to_user expression ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/user_id_to_user%20expression%20ex%20in%20app.png)

---

Did you find what you were looking for?

You can also head to [community.tulip.co](https://community.tulip.co/?utm_source=intercom&amp;utm_medium=article-link&amp;utm_campaign=all) to post your question or see if others have faced a similar question!

**Expression**

A configured code snippet that returns a calculated value based on certain inputs. **Expressions**have access to all of the variables, Table Records, and any other data available to an application.

**Trigger**

**Triggers** are groups of logic that are tied to an app event, such as step open, timer, widget interaction, etc. App builders can add triggers to **widgets**, **machines**, **devices**, **apps**, and **steps**.

**Triggers** can contain **actions**, **transitions**, and **conditions**.

**Boolean**

**Boolean's**are a Tulip Datatype. Booleans can have True/False (Yes/No) values.

**Datetime**

**Datetimes**are a Tulip Datatype. Datetimes represent a time in the ISO8601 format.

*ex. 2022-08-31T19:56:16+00:00*

**Image**

**Images**are a Tulip Datatype. Images are a reference to a web-hosted location for all Tulip Images.

**Integer**

**Integers**are a Tulip Datatype. Integers can have any whole number.

*ex. -5, 15, 47, 155. **NOT** 15.2, -12.73*

**Number**

**Number**is a Tulip Datatype. Numbers can be any positive or negative number. Numbers support decimals.

*ex. -5, 15, 47, 155, 15.2, -12.73*

**User**

**User**is a Tulip Datatype. Users represent a single user in your Tulip **Instance.**User****variables include attributes like **Badge Id, Name, and Shift.**

**Interval**

**Interval**is a Tulip Datatype. Intervals represent pieces of time, represented in seconds. Intervals can be added or subtracted from **Datetime**variables.
