Skip to main content
The Condition Mapping Editor supports adding conditions to destination nodes so that they are only included in the output document if the condition is true. The editor also enables you to set the value of a destination node based on values from the source. You can build complex conditions by adding individual rules and/or groups of rules, then specifying what action the mapping should take when the condition is satisfied. To open the editor, hover over a node in the destination document and click the filter filter icon. Give the condition a name, then click Add Rule or Add Group. The Value field is pre-filled with the source element’s XPath. Click into it to open a dropdown if you need to select a different source value. When you build your rules, use the dropdowns to make your selections. You can choose from the following:
  • Input XML
    • Value: The value at the XPath being evaluated
    • Data Type: The data type of the value (String, Number, DateTime)
    • Occurrences: The number of times the XPath occurs in the document
    • Index: The index representing the current iteration of the Foreach loop that is being evaluated
  • Message Header
    • Value: The value of the message header being evaluated
    • Data Type: The data type of the value (String, Number, DateTime)
  • Variable
    • Value: The value of the variable being evaluated
    • Data Type: The data type of the value (String, Number, DateTime)
The right side of each rule (after the operator) has its own source dropdown. In addition to the sources available on the left side, it includes Static Value, which is only available on the right:
  • Static Value (default): A free-text input for a literal comparison value. Only available on the right side.
  • Input XML
  • Message Header
  • Variable
There are some restrictions on the right-side dropdown:
  • The source dropdown is locked to Static Value when the operator is contains, starts with, ends with, matches glob, matches regex, is in, or is not in, or when the left-side type is Index or Occurrences
  • The right side is hidden entirely when the operator takes no value: is empty, is not empty, is null, and is not null
  • When the left-side type is Data Type, the right side dropdown shows a fixed set of options: String, Number, or DateTime
When you select an XPath for a condition, the editor displays a tree representation of the document so you can easily find the XPath you need, as shown in the image below. You can reorder rules and groups. Click the handle handle and drag the object to a new location. When you have completed defining the condition, use the right-hand pane to specify what should happen when the condition is satisfied. Choose a status of:
  • Success
  • Warning
  • Error
Check Send a Notification and complete the To and Subject fields to send an email about the status of the condition.
Click Configure Alerts to open the Alerts page in a new browser tab, where you configure your email settings. If these are not configured correctly, email notification fails.
Finally, use the Else section of the right-hand pane to specify what should happen when the condition isn’t satisfied. Use the Else, Set Action to dropdown to choose whether to:
  • Exclude Element from the mapping altogether
  • Map Value to map the value anyway
  • Assign a Different Value to assign a different value (defined as an expression or custom script once you save the condition)
The status and notification options work in the same way as the top section. When you save the condition, it appears in the mapping editor and behaves in the same way as any other leaf node in the mapping. You can drag-and-drop an element from the source side, or write expressions or custom scripts for it. Conditional logic can also be accomplished using lookahead syntax. Parent elements are often qualified by a child element that provides context to the values inside the parent. In these cases it might be easier to use lookahead syntax rather than create multiple conditions to exclude unwanted values. See Lookahead for more details on using lookahead syntax.

Script Mode

You can use ArcScript syntax to specify custom conditions by toggling on the Script Mode toggle in the upper right corner.

Script Mode in Mapping Conditions

Once you toggle script mode on, use the window to write your custom conditions, then use the right-hand pane in the same way as described above to:
  • Set the status of the message
  • Send notifications
  • Add Else conditions to your mapping, including excluding elements from the mapping if the condition is not met
  • The editor validates your condition as you type. If you see an Invalid Condition message, you have some sort of syntax issue that must be resolved.
  • If you create an ArcScript condition that cannot be rendered in the designer, when you switch back to designer mode you are warned that Arc cannot render this configuration in designer mode. If you switch to the designer mode you lose all changes to the existing configuration.

Examples

One common use of the custom condition editor is to compare two dynamic values from the source document (instead of comparing a single dynamic value against a static value). For example, you could use the following custom condition to see whether two values in the source XML are equal: '[xpath(element1)]' == '[xpath(data/element2)]'
The single quotes in the example above are required.
You can also perform boolean logic in custom conditions by using ArcScript formatters, as in the following example: [xpath(element1) | equals([xpath(data/element2])])] Notice that this syntax does not require single quotes. The following example compares an XPath to a _map variable set earlier in the mapping. The def(0) formatter provides a fallback if the XPath value is absent before the comparison runs. [xpath(FST/FST01) | def(0) | greaterthan([_map.OverUnderShipQty])]
This example uses Script Mode because _map variables are not available in the designer’s right-side source dropdown. For comparisons between other dynamic values (such as XPath versus XPath, or XPath versus a message header or variable), you can use the right-side source dropdown in the Condition Editor designer instead of Script Mode.
This example filters by a date relative to today. Use this pattern when you need to check whether a date field falls within a window relative to the current date. For example, if Datetime is 2026-10-05 and today is 2026-09-28, datediff('day') returns 7, so the condition is satisfied. [xpath(Datetime) | datediff('day') | isbetween(0, 15)] datediff('day') returns the difference in days between the date field and today: positive for future dates, negative for past dates. isbetween(0, 15) is inclusive of both bounds, so the condition matches today through 15 days from now, and the negative values for past dates fall outside the range. See Formatters for details on all of the ArcScript’s formatters.