After selecting the field where Field Calculator will write the result of the operation, access its configuration page.
At the top of the page, you will find some information about the Field to Value.
-
Field to Value:
The name and type of field where Field Calculator will write its results; -
Database:
The database to which the field to value belongs. If the field is shared, the Master Database will be indicated.
Narrow target
In this section, define which contacts are concerned by the calculation of the Field Calculator.
By clicking on the Edit Filter button, you can narrow the target of the operation by applying specific conditions.
By default, all contacts are selected regardless of their status (and the database to which they belong) if the field is shared. To limit the update to active contacts only and/or to a single database if the field is shared, add specific filters for these conditions.
The "Count Filter Contacts" button allows you to know which contacts will be affected by the Field Calculator calculation.
Expression
In this section, you set the operations that will be executed by the Field Calculator.
Each operation consists of two parts: the conditions and the actions.
If the conditions are met, then Field Calculator performs the actions. You can make it so that if none of the specified conditions occur, Field Calculator executes an alternative action.
To create a new operation, click on the "Add Condition" button.
Two fields will be added to the table:
- The If field where you set the condition;
- The Then Assign Value field where you write the calculation to perform.
You can add new conditions and calculations by clicking on the "Add Condition" button.
If you have added multiple conditions, the Field Calculator will proceed sequentially by analyzing the first contact and checking the first condition. If the first condition is met, Field Calculator will write the result and move to the next contact.
If the condition is not met, Field Calculator will move to the next according to the configuration order of the conditions.
If at the end of the analysis none of the conditions is verified, the default value of the Otherwise field will be applied.
If you leave the Otherwise field empty, in case no condition is met, the calculated field will be emptied.
If you want the value of the calculated field to remain unchanged, enter one of the following keywords (strictly in uppercase and without quotes):
- BREAK
- RETURN
- END
To delete a condition, click on the trash icon.
Test the operation
You can verify the correct configuration of an operation before executing it definitively.
Before running the verification, save the operation by clicking on the Save button at the top right, then click on the "Preview for Contact" button.
The test window will be displayed.
In the Contact ID: field, enter the ID of the contact on which to perform the test.
To know a contact's ID, enter its profile within the database to which it belongs.
In the browser's address bar, locate the string
idlettore=
.The number following the = (Equals) will be the contact's ID:
After entering the ID, click on the Preview for a Contact button.
If everything is configured correctly, the window will display a new row containing the result of the operation on the selected contact.
Values and operators
The conditions entered in the If field are expressions that return a true
or false
value.
To write a condition, you can use the operators EQ, NEQ, GT, GTE, LT, LTE, CONTAINS
and the logical operators AND, OR, NOT
.
The values, on the other hand, are expressions that should return a result of the same type as the field where they will be written.
Examples of values:
-
'Mario'
text string -
10
number -
contact.values.NAME & '-' & contact.values.SURNAME
concatenation string -
(contact.values.A + contact.values.B)/2
string for value calculation
Scheduling
The operations of the Field Calculator can be executed on request or according to a configurable schedule in the appropriate section.
Execution can be:
On-request scheduling
Does not follow a schedule. The operation is launched each time you click on the "Launch Calculation" button.
On-request execution does not interfere with configured schedules.
The actual start of the operation may not be immediate. The calculation will be executed by the Field Calculator as soon as possible, taking into account the number of operations already scheduled on the platform.
Daily scheduling
The calculation is launched every day at the time specified in the At Hours: field.
The time should be entered in hh:mm format.
Weekly scheduling
The calculation is launched on the day and time indicated in the Day of the week: and At Hours: fields.
The time should be entered in hh:mm format.
Monthly scheduling
The calculation is launched once a month.
In the Day of the month field, indicate which day the operation will be executed. If you enter the number 31, this will correspond to the last day of the month, regardless of the duration of the month itself.
In the At Hours: field, enter the execution time of the calculation in hh:mm format.
Once you have finished configuring the operation, click on the Save button at the top right to save the configuration.
In the Manual Launch section, you will see the results of the last operation execution.
List of operations
Once saved, the calculation you created will be added to the main page, in the list of already created operations.
By clicking on the icons to the left of the Field ID subject of the operation, you can:
-
Access the configuration menu of the calculation
-
Launch the calculation operation with immediate execution
-
Delete the operation
- The Scheduling Type column provides information on the type of schedule set for the different operations.
- The Database column indicates the database(s) on which the calculation will be performed.
- The Next Execution column indicates, if the operation is scheduled, the date and time of the next execution.
In the right-click menu, there is an option Go to the list of operations.
This option takes you to the page containing the list of all operations configured on the platform (not just those created by the Field Calculator, which is only one of the many types of actions present).