Skip to main content

Dynamic

Operation

Format

Description

Example

Conditional Value

ConditionalValue({Variable}, {Condition1}, {Result1}, {Condition2}, {Result2}, ... , {DefaultValue})

Compares a variable to a set of condition-result pairs and returns the corresponding result when the variable matches a condition (also known as a "switch" function). If the variable does not match any of the conditions, the default value is returned.

Input: ConditionalValue({A}, “yes”, 10, “no”, 20, 0)

Result: If yes is the provided variable, 10 is returned.

Convert Inner Items to Array

ConvertInnerItemsToArray([{key 1},{value 1}])

Iterates over inner items and creates an object for each inner item using one or more key-value pairs for each object.

This formula is only available in the module builder; you cannot use this formula in the formula builder, independent of inner item logic.

Input: ConvertInnerItemsToArray(["key1","Initiative Id"])

Result: [{"key1": "INIT5Gd40jR2d7h"}, {"key1": "INITjr5Pwx6Gr0q"}, {"key1": "INITRtv8lp2Sx7d"}]

Convert Object to Keyed Array

ConvertObjectToKeyedArray({Field},{JsonPath})

Reformats JSON objects not in an array into a JSON array, replacing the root key with "tonkean_original_key": "{keyValue}". The resulting array is easier to parse and manipulate.

The main use case for this formula is handling API responses in JSON format, where this formula enables you to more easily iterate on records returned in non-array responses.

Input: ConvertObjectToKeyedArray({ "item_1": { "title": "Item 1", "created": "04/12/23" }, "item_2": { "title": "Item 2", "created": "04/13/23" }},"$")

Result: [ { "tonkean_original_key": "item_1", "title": "Item 1", "created": "04/12/23" }, { "tonkean_original_key": "item_2", "title": "Item 2", "created": "04/12/23" } ]

Note in the above example that the node key is added to each object in the resulting array as the value for key "tonkean_original_key", creating a unique identifier for that record.

Subtract

{FieldA}-{FieldB}

Difference between two values.

Input: 9 - 6

Result: 3

Sum

{FieldA}+{FieldB}

Sum of two values.

Input: 2 + 3

Result: 5

Text Analysis

TextAnalysis({Variable},{Expression1},{Result1}, {Expression2},{Result2},{DefaultValue})

Compares a variable to a set of expression-result pairs and returns the corresponding result when the variable matches an expression (also known as a "switch" function). If the variable does not match any of the expressions, the (DefaultValue) is returned.

Input: TextAnalysis("Tonkean", "Tonkean", "test1", "123", "test2", "test3")

Result: test1