About this article
Functions are a piece of code that accomplishes a task. Typically, they take input and produce an output. Currently, in Templafy, most functions are string functions that take a string or a set of strings as input, perform a task on them, and return an output. Below is a comprehensive list of all the available functions to date, they're linked to pages that go more into depth and provide examples for each function.
Sections in this article:
Prerequisites
|
General functions
- IfElse(Condition, TrueValue, FalseValue) - Provides output based on a condition
- DataSourceName[NameValueToLookUp] - Get a row of a data source
- ExternalDataSourceName[NameValueToLookUp] - Get a row of an external data source
- Switch() - Compares one value to multiple values and returns results accordingly
- Translate() - Returns a row of the translations data source
Date functions
- FormatDateTime(String, String, String, String, String) - Formats a date
- Now() - Returns the current date
- DateAdd(Date, Number) - Adds days, weeks, months, quarters, or years to the selected date
- DateSubtract(Date, Number) - Subtracts days, weeks, months, quarters, or years from the selected date
- DateValue(DateTime, Format, Region) - Converts a DateTime in text format into a date object for use in other date functions such as FormatDateTime()
Text functions
- StringJoin(Separator, Text1, Text2, Text3) - Joins multiple pieces of text with a separator
- Concat(Text1, Text2) - Joins two pieces of text together
- Upper(Text) - Converts text to upper case
- Lower(Text) - Converts text to lower case
- Proper(Text) - Converts text to proper case (first letter of every word capitalized)
- SentenceCase(Text) - Converts text to sentence case (first letter of a sentence capitalized)
Numerical functions
- Ticks(Text) - Get a random number
- FormatNumber() - Format number input
Related articles
Comments
0 comments
Article is closed for comments.