You can control your synchronisation precisely using conditions. Conditions determine whether a data set is synchronised at all (both for create and update). You can configure conditions in a number of ways with different field types and nested structures. This way you can easily realise complex synchronisation conditions.
To set conditions in your plan, navigate to the Connection tab. If you use a bidirectional plan, select the corresponding synchronisation direction. You will see the mapped fields and below them is the configuration area for the conditions, directly below the actions.
To add a condition, click on the Add Variable button.
The following fields then pop up (see picture below): Type, Source, Value.
The upper part describes the left side of the equation and the lower part the right side of the equation.
For Type you can select the following field types:
It is best to always select Field in the top line. If you select Field, the Source option opens in the middle. Here you can choose between Input and Output. Here you decide whether you want to select a field in the system from which you synchronise (Input) or into which you synchronise (Output). Under Value you enter the name of the field for the type Field, otherwise the value of the type. At the top right you can select the logical operation. The screenshot shows the operation Equals. More options for logical operations:
- not equals
- less than
- greater than
- begins with
The options for Type mean the following:
- String: Here you can set conditions based on text.
- Null: Is the value when a database field is empty, i.e. contains nothing, regardless of the data type.
- Boolean: Is the data type for the values true/false.
- Integer: Here you can set conditions based on integers.
In our example below, this means that the field deleted must have the value 0 in the system we are synchronising from in order for the record to be synchronised at all.
Of course, you can also combine and chain several conditions. To do so, simply click on the Add Variable button again.
We have extended the condition so that the field processed must be equal to the string “unprocessed“. The two conditions are linked with a logical AND (logical operators). This means that both conditions must be true for synchronisation to be executed.
Now we want to realise a more complex condition. To do this, we delete the second condition, as we nest it with another one. We now model a nested condition. Nested conditions are also often represented with brackets. To add brackets, we click on the button Add Container.
We want to model the following synchronisation condition (in different notations):
(deleted == 0) & (processed != 1 | processed == null)
(deleted == 0) AND (processed != 1 OR processed == null)
deleted is equal to zero and either processed is not equal to 1 or is equal to zero
The first container contains the condition of the deleted field and the second container contains the two conditions, each with the processed field. The logical or refers to within the second container. The logical and refers to between both containers.
Both the first term (first bracket) and the second term (second bracket) must apply. The first term of the condition is collapsed in the image below (with the Show More button).
If you need help or advice setting up your conditions, just contact us. We will be happy to help you!