Salesforce

Using the Expression Editor (Magic xpi 4.5)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

Using the Expression Editor (Magic xpi 4.5)

To create an expression with the Expression Editor:

  1. Click any button to open the Expression Editor.

  2. Build an expression in one of the following ways:

    1. By entering the different parts of the expression manually.

    2. By using the auto-complete facility, which is accessed by pressing Ctrl+SPACE. This searches the variables and the functions, and gives you a list of appropriate matches in the form of a drop-down list. By double-clicking on the list, you can select the required variables or functions to include in the expression. If you are using a Chinese machine, whose Region and Language dialog box's Format field is set to Chinese, the auto-complete facility is accessed by pressing SHIFT+SPACE.

    3. By activating the drop-down list of variables and functions, as previously described, by using Ctrl+SPACE. You can then select the required variables or functions by double-clicking on the main drop-down list. If you are using a Chinese machine, whose Region and Language dialog box's Format field is set to Chinese, the drop-down list of variables and functions is accessed by pressing SHIFT+SPACE.

    4. By clicking one of the following buttons, and then selecting the required variable or function either by double-clicking it or parking on it and then pressing SPACE or Enter:

Button

Shortcut

Description

Ctrl+1

Opens the Functions list. Functions in expressions are shown in red.

Ctrl+2

Opens the Variables list. Variables in expressions are shown in blue.

Ctrl+3

Opens the Environment Variables list. Environment variables are automatically converted by the Expression Editor to the EnvVal('env_var') format. Here, EnvVal is shown in red (since it is a function) and the environment variable itself is shown in black.

Ctrl+4

Opens the ODS list. ODS variables in expressions are shown in blue.

Ctrl+5

Opens the Source nodes list. This is only enabled when editing an expression in the Data Mapper. Source nodes in expressions are shown in blue.

Opens the PSS list. PSS topics in expressions are shown in blue.

Ctrl+O

Opens an operating system file dialog box with which you can select a file. Once a file is selected, its full location is imported into the Expression Editor. Note that only the path and name are imported, not the contents. File paths in expressions are shown in black.

  1. Once you have built your expression, click Verify to check that it is a valid Boolean expression.

  1. Click OK to create the new expression. The Expression Editor closes, and the expression you created is displayed in the Flow Editor.

Click Clear to clear the expression. You can also press Shift+Delete to delete the expression.

Click Cancel to close the Expression Editor without creating a new expression.

Note:

  • When you build conditions in any of these ways, the Boolean operators should be added manually.

  • Text operations and concatenations must be done for string variables. The Expression Editor does not support concatenation of the BLOB variable.

  • When you want to concatenate information to an Alpha variable, you need to use the ampersand (&) character.

  • For logical variables, you can use True or False as well as 'TRUE'LOG and 'FALSE'LOG.

  • Once you have selected a variable or function from the Open Assistor or Functions list, you have to press SPACE if you want to use these lists again.

  • When you select an XML path using the toolbar button, one space will be added at the end of the path to distinguish it from operators that come after the path. When you type the node path in an expression, you need to add the space manually.

  • You can use Ctrl+F to access the Open dialog box. You can then select an expression from a file.

  • When an object that is used in expression is deleted from its repository, it will appear as three question marks (???) in the Expression Editor. If this is the only data in an expression, then after clicking the Verify or OK button, it will turn into an Alpha string with a value of ???, that is, '???'. In other cases, such as if it is a part of a concatenated expression, it will not be wrapped in single quotation marks and the expression will remain invalid.

  • Separators for dates and times must match the separators defined in the Magic.ini file: Date Separator and Time Separator.

  • The date mode used in an expression must match the date mode defined in the Magic.ini file: Date Mode.

You can also create or edit new flow, context, or global variables on-the-fly, as shown in this section. Once you have added or edited the variable, it is immediately available for use in the Expression Editor.

Note:

An example of a valid Boolean expression:

CustomerID = 'Group A' + SSNumber

Where CustomerID and SSNumber are Flow Variables and Group A is a text string. This will create a Customer ID that is made up of the word Group A and a predefined SSNumber. The text string 'Group A' must be enclosed in single straight quotation marks (' '), and there must be a space between the variable or string and the operator.

Reference
Attachment 
Attachment