Overview
Functions in Tines allow you to perform calculations, manipulate strings, and work with data in creative ways. They are essential for transforming data in your workflows and can be applied to data at any point in the automation process.
Tines has a set of built-in functions that you can use to manipulate data, here are some examples:
Mathematical Functions: Functions like
SUM,SUBTRACT,TIMES, andDIVIDED_BYallow you to perform operations on numbers.Text Functions: Use functions like
CONCAT,TITELIZE, andDOWNCASEto manipulate text. These functions are useful for formatting data or combining text values.Logical Functions: Functions like
IF,IS_PRESENT, andOR, andSWITCHallow you to create conditional logic in your workflows.Time Functions: Functions like
NOW,DATE, andDATE_DIFFallow you to manipulate date and time data.
Tines references
Before getting started, we recommend familiarizing yourself with the surrounding functionality this article covers:
Make it happen
Scenario
Copy (CMD + c) the JSON block provided below and paste (CMD + v) it onto the storyboard (these are action tiles and will auto-populate!). Run them and see how the different Tines functions executed within the Events panel:
Utilize the
IFfunction to return a message based on a passed value.Utilize the
DIVIDED_BYfunction to divide two numbers.Utilize the
TITLEIZEfunction to capitalize the first letter of each word in a string of text.Utilize the
NOWfunction to return the current date and timestamp in UTC.
Actions
{"standardLibVersion":"81","actionRuntimeVersion":"32","agents":[{"disabled":false,"name":"Functions","description":null,"options":"{\"mode\":\"message_only\",\"loop\":false,\"payload\":{\"logical\":\"=IF(data.color = \\\"Blue\\\", \\\"Blue is my favorite color!\\\", \\\"This isn't my favorite color.\\\")\",\"mathematical\":\"=DIVIDED_BY(data.number, 2)\",\"text\":\"=TITLEIZE(data.message)\",\"time\":\"=NOW()\"}}","position":{"x":165,"y":1095},"type":"eventTransformation","timeSavedUnit":"minutes","timeSavedValue":0,"monitorAllEvents":false,"monitorFailures":false,"monitorNoEventsEmitted":null,"caseConfiguration":{"subStatus":null,"tags":[]},"recordType":null,"recordWriters":[],"form":null,"createdFromTemplateGuid":null,"createdFromTemplateVersion":null,"templateTags":[],"originStoryIdentifier":"cloud:0a13dfc5dbb71212cab0ad314b7fe531:f0064f807ac02bf877a6ff31d9b76916"},{"disabled":false,"name":"Data","description":null,"options":"{\"mode\":\"message_only\",\"loop\":false,\"payload\":{\"color\":\"Blue\",\"number\":8,\"message\":\"welcome to tines!\"}}","position":{"x":165,"y":1005},"type":"eventTransformation","timeSavedUnit":"minutes","timeSavedValue":0,"monitorAllEvents":false,"monitorFailures":false,"monitorNoEventsEmitted":null,"caseConfiguration":{"subStatus":null,"tags":[]},"recordType":null,"recordWriters":[],"form":null,"createdFromTemplateGuid":null,"createdFromTemplateVersion":null,"templateTags":[],"originStoryIdentifier":"cloud:0a13dfc5dbb71212cab0ad314b7fe531:f0064f807ac02bf877a6ff31d9b76916"}],"links":[{"sourceIdentifier":"1","receiverIdentifier":"0"}],"diagramNotes":[]}