Skip to main content

Functions FAQ

FAQs about using functions in Tines.

Written by Jamie Gaynor
Updated today

A function is a reusable instruction that you can use to perform certain tasks in Tines. This article explains functions in Tines.

Is there any performance difference between nesting function calls vs. using the pipeline?

There is no difference in performance when using nesting functions rather than pipelines.

Examples:

  • Nesting functions: func2(func1())

  • Pipeline: func1() |> func2(%)

For more information on operators in Tines, see here.

What timezone does DATE("now") function return?

DATE("now") will return a UTC time.

Read about the DATE function in our docs.

You can find an example of DATE function uses in the story library

What type of regex does Tines use?

Tines uses Ruby-compatible regular expressions (regex).

You can use https://rubular.com/ to test your regex as you build.

How do I find which object in the array has the largest ID?

You can use SORT() to sort the array based on the key and then use LAST() to select the last object in the sorted array (the highest value)

SORT(example.data, "id") |> LAST(%)

To learn more about working with arrays, click here.

How can I remove unwanted elements from an array?

The REJECT function can remove unwanted elements from an array. This example removes empty strings from an array.

REJECT(array, ["", NULL, 0, FALSE])

Read about all of our functions in our docs here.

Did this answer your question?