Just like in spreadsheets, formulas in Tines allow you to transform data. Where a cell in a spreadsheet uses a formula to refer to other cells, a formula in a Tines action references upstream actions or other data sources throughout the platform.
Here are a few examples of what you can do with formulas:
# convert some text to uppercase UPCASE(user.job) # logic IF(user.job = "Engineer", "likes code", "dislikes code") # tap into our large library of powerful functions CSV_PARSE(fetch_csv.body)
Formulas are most frequently used in actions. Add a formula expression to a text field inside a 'pill' using the inserter in action options or use the keyboard shortcuts available:
Value: CTRL ⎵
Tag: CTRL ⇧ ⎵
Use the popup formula builder to author your formula expression. We’ll show in-line help and documentation as you type, and a preview of the result.
Formulas pills inside text fields: tags vs values
There are two types of pills: values and tags.
Value pills are replaced with the result of their formula expression when the action runs.
Tags on the other hand control the flow of execution. Tags are particularly useful for doing things like building emails.
Formula pills in text fields, vs formula fields
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.
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.
To do this you can use a formula field, instead of a text field: