Skip to main content

How to use functions

Stéphane Jauffret avatar
Written by Stéphane Jauffret
Updated over a year ago

Functions allow you to transform your content deeply.

They can be inserted in rules, either in conditions or in actions.

Find the full list of functions here and their precise usage. Or examples of how to use them on this page.

There are two types of functions:

  • validation functions: return TRUE or FALSE on a given question

  • transformation functions: modify the content

Functions can be called in rules like this:

Functions usually have arguments. Those arguments can be hard values or dynamic content coming from your file.

Example

👉 Assume you have a myPrice column in your input file and want to add 3$ to the price that is in your file, you would use the add function like this, in the expression:

$add(%(myPrice),3) 

The symbol $ stands for "transformation function"

The symbol % stands for "input column"

The symbol # stands for "target column"

The symbol ? stands for "validation function"

It will look like this in the rule:

In your input file:

As a result of applying the function:

Using input columns or target columns.

Most of the time, using the target columns will do what you want. If you have just one transformation to do on one column, results will be the same as if you used input column.

However, if you have multiple transformations to apply to a single column, you need to use the target column in your action expression. By doing so, your successive rules will be using the result of the previous rules.

Assume you want to first add $3 to your myPrice column, then add another 15%. You need to use the target column for your rules.

Did this answer your question?