Hello World
Automation Rules Training Exercise 1

Hello World

In this exercise you will learn how to build your first very simple automation rule: when the task “Reserve a Parking Space – Approval” is started, this automation rule must add a note to this task with the following text “Hello Hank”

Records console

Go to the Records console and select the “Task Templates” option from the list of record types. Select the “Reserve a Parking Space – Approval” task template and click on the Actions menu.

Actions button
Select “Automation Rules…” from the actions menu.

On the next “Automation Rules” screen click on the ‘+’ sign in the top right corner to add your first Automation Rule. Give it the name Exercise 1 - Say Hello.

It is a good practice to add a functional description of the automation rule in the description field, in this case:
’when this task is started add a note to this task with the following text “Hello Hank”. ’

As Trigger select “On create”.

Define an expression: set the name of your expression (overwrite the name ‘expression1’) to my_name and give it the value 'Hank'.

Questions:

Expression names are case sensitive. This means that “My_name is” different to “my_name”. So, you could use uppercases, but this can be confusing. It is strongly recommended that you only use lower case for expression names.You cannot use blank spaces in the expression names. In fact, when you fill in a blank space, the 4me system will convert the blank space in an underscore sign ‘_’ .

A word or a sentence in quotes is considered to be a string and can be used to assign a value to an expression. The system will consider a word that is not in quotes to be an expression. If that expression was not defined in a previous statement, the system will give an error and the word will be displayed in red.

You can use single quotes or double quotes. However, it is recommended that you use single quotes to make your expressions easier to read.

Set true in the Condition.

Question:

The word true is a predefined expression. Another predefined expression is false. Take care: the string ‘true’ surrounded by quotes has another meaning and should not be used in the field Condition. See the 4me help page on automation rules for other examples of predefined values

Add automaion rules action

Now you can create an action. Hover over the “Add action” line. To the right you will find the available actions. Select the “Add Note” action.

Leave the “Update” field on current record and write "Hello " followed by 2 curly brackets. Once you have entered the 2 curly brackets a pop-up with available expressions appears. Select the expression my_name.

Update current record
Add note Hello {{my_name}}

Your automation rule should now look like this:

Exercise 1

Now save your first automation rule, and close the Automation Rules window.

The logic of this rule is very simple: the rule is triggered when the task is created. Then, a note is added to this task (‘current record’). This will always be done because the condition is always true. The text in the note equals Hello ‘my_name’. my_name is an expression with the value ‘Hank’. So the text in the note will become ‘Hello Hank’.

Let’s go to the next exercise to test the rule.

Next Exercise