Skip to main content

If/else statement

In the Expression Builder, the if / else statement can be written as follows:

condition?value if true:value if false

You can perform a null test before calling a Java method; otherwise it will throw a null pointer exception if the input data contains a null value. For example:

row1.Postal_code==null?null:row1.Postal_code.toUpperCase()

You can also write a nested statement. For example, use the following expression to retrieve the new salary for each employee based on his/her original salary.

row1.salary>=10000?row1.salary*1.05:(row1.salary>=8000?row1.salary*1.1:(row1.salary>=7000?row1.salary*1.08:row1.salary*1.2))

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!