Choose instruction

With the choose instruction, you can build an output in the right panel from complex expressions, depending on multiple conditions from the input. If none of the conditions are met, then a final expression can be targeted; it is known as otherwise. The output corresponding to each condition can combine multiple input values from the left panel, using operators such as concatenation.

The choose instruction is similar to the If instruction, with multiple conditions instead of one. 

There are two possibilities to add a choose instruction. You can either

  • Right-click on a link element, then select Set Functionchoose.
  • Select the choose icon in the Palette (on the right hand side), then drag the first input element (in the left panel) and drop it on the target in the right panel.

You can then either:

  • Use drag and drop: drag more elements from the left panel to the choose link in the center, to serve as alternative inputs or as condition elements.
  • Or open the Edit choose box, to edit the parameters in detail: right-click on the link element and select Edit... (or double-click the link element).

Example of using the choose instruction

In the following example, you can see several possible inputs on the left (iban and ownerName), connected to the choose element in the center by a solid blue line. The value of the output (id) can be either one, depending on the value of the condition (currency). The condition (on the left) is connected to the choose element by a green dotted line.

Below is the Edit choose dialog box corresponding to the example above. It is showing one of its conditions (currency!='EUR') ; each condition is represented by a tab. The output corresponding to that condition can be the value of one of the input elements from the left side (here, iban), or it can be a complex expression derived from several inputs, connected by operators. You can drag elements from the left side into the top or bottom areas in the center, to build expressions for the condition and the output. . ....

Related Links