Skip to main content

Data type conversion

Learn some tips for converting data in Tines

Written by Jamie Gaynor
Updated yesterday

Converting a string into an integer in Tines?

To convert a string into an integer in Tines, you can use the NUMBER function.

To learn more about the NUMBER function with examples, see here.

Ensuring your data maintains its original format

When you use a pill within a piece of text, the value is converted to text and joined with any surrounding text.

This isn't always what you want, sometimes you will want to add a complex object directly to a payload. To do this you can use a formula field, instead of a text field, inside the builder window. Using a formula field will return the value directly, rather than converting it to text. This is useful for cases where you want to return a dynamic non-text value, like an array or an object.

Read more about using pills and formulas here.

Text mode v Formula mode

You can choose the language type in the builder to control the data type of the output:

  • text_mode: If you have a value in text mode, it will treat the output as a text string.

  • formula: If you set the value to formula mode, it will treat the output as an object (array or JSON object, depending on the output of the functions used)

You can change the language type in the builder as shown below:

Sample event output:

In this example:

  • text_mode treats the output as a text string,

  • formula outputs an array object

Did this answer your question?