Formulas allows you to transform data. Formulas consists of a set of nodes that form a tree like structure.

A toddle formula that generates the String “HELLO WORLD”, First the strings “hello” and “world” are converted to uppercase, then they are concatenated with a space in between.

A toddle formula that generates the String “HELLO WORLD”, First the strings “hello” and “world” are converted to uppercase, then they are concatenated with a space in between.

Formulas can contain as many nodes as are needed. You can see the output of the formula in the output node furthest to the right.

Each node in a formula can have 0 or more “inputs” and will produce exactly one output.

This formula node has 3 inputs, “HELLO”, a single space character and “WORLD” and will product the output “HELLO WORLD”.

This formula node has 3 inputs, “HELLO”, a single space character and “WORLD” and will product the output “HELLO WORLD”.

Some Formula nodes can accept a varying number of arguments. In the example above The CONCAT formula node can accept any number of strings, and will concatenate them all together.

Formulas will have access to different types of data depending on what data is available to the component.

E.g. if a component has a variable called “Show modal” then that variable will be available to all formulas inside that component.

Formula Reference

toddle comes with several built-in formulas, you can find more information about these below.

APPEND

ABSOLUTE

ADD

AND

BOOLEAN

CEILING

CLAMP

CONCAT

DATE_FORMAT

DEFAULT

DELETE