Match & Replace action

Technical node name: MatchReplaceDef

A Match & Replace action can be used in two different ways: Match or Replace. A Match action searches for a specific tag in an Exchange item, allowing you to, for example, switch between two paths in an action tree (such as: all e-mails from sender A are stored in one location, while all e-mails from sender B are stored somewhere else).

MatchReplaceDef node, definitionMatch & Replace action, create

A Replace action performs the same search as in the Match action, but then changes the tag in some way. The most common use of the Replace action is to add a subject marker like [ELO] to e-mail messages in order to signify that they have been stored in the repository.

A Match & Replace action is performed on Exchange items, and if you are using the Replace functionality, it must be followed by a Commit action.

Target field name: Enter the field name which the Match & Replace action will be performed on.

Type: Select whether the action performs a search for a certain type of information (Match) or if a search should be performed, followed by some kind of change to the information (Replace).

Logics: You can choose between AND of ORs (CNF) and OR of ANDs (DNF) as the Boolean logic governing the action. The default option is CNF.

AND of ORs means that at least one of the Match entries in all of the Prop elements (field name) within the action must be found in order for the action to return true. This logic mode is required for entering an [ELO] to the subject line of processed e-mails, for example: One of the matches finds messages with any kind of subject line. Another match takes messages into account that have no text at all in the subject line. One of these rules will apply to every e-mail processed, but never both.

OR of ANDs means that all of the Match entries in one of the Prop elements (field name) within the action must be found in order for the action to return true. This logic mode is useful, for example, in locating e-mails that fulfill several criteria for special processing. For example, you could detect incoming invoices that contain a valid name, tax ID, total invoice amount, etc. and send these e-mails into a branch of the action tree that starts an associated workflow.

Mode: Select between Simple, Regular expression, Constant, and Field name. These options affect the type of filter constructed by the Match field below.

Simple: Enter a plain text string to the Match field as a filter. You may use * and ? as wildcards. A simple pattern is converted internally to a regular expression by ELOxc.

Regular expression: Enter a regular expression to the Match field as a filter.

Constant: Enter a text string to the Match field as a filter. This mode type does not support wildcards.

Field name: Enter a field name to the Match field as a filter. Exchange items without this tag will be filtered out.

Match: Enter an expression that will be searched for within the field name specified above.

Replace: This field appears if you selected the Replace operation. Enter the type of text that should be entered to the index field if the text in the Match field is found in the field name.

Requirements

A Match & Replace action requires the entry of a target field name and the search text or expression.

Replace example

You can use placeholders in a replacement operation. An Enter [ELO] subject marker action can serve as an example here.

When (^.) is entered to the Match field, the ^. means "find the first occurrence of any character". The () means "capture everything within this for use later".

Finally, $1 means "put the first text captured from a pair of parentheses () here". Thus, [ELO] $1 in the example places the characters [ELO] in front of the very first character in the e-mail subject line.

Range search

It is possible to use ranges within a Match & Replace action. This allows you to, for example, only process messages between 100 and 1000 kilobytes within a certain action tree by matching messages of that size. The range search has a few strict requirements, however:

Range searchMatch, range
  • The data type must be a number or a date. Strings must be checked in ELOxc EWS using a regular expression, which cannot be used in combination with the range search.
  • The Mode attribute in this match type must be Constant.
  • The order of the entries in the range must be entered with the lower bound followed by the upper bound. See the examples below for concrete examples of this.
  • You can use any character as a delimiter between the lower and upper bound, but you must specify this in the Delim attribute.
  • Static calendar values must be entered in ISO format (YYYYMMDDhhmmss.
  • Dynamic calendar values must be entered as DDDhhmmss.

Please note: The user who sets up the action must ensure that the range is valid and useful. ELOxc does not perform a plausibility check on the range. Incorrectly selected values here may result in unintended results.

Example 1 (numeric range): This type of range can be used with PidTagSize or PidTagMessageSize, for example.

  • Pattern: 100;1000
  • Delim: ;
  • Mode: CONSTANT
  • Result: Messages with a size between 100 and 1000 bytes will return true.

Example 2 (static calendar check): This type of range can be used with PidTagMessageDeliveryTime, for example.

  • Pattern: 20160801000000-20160830235959
  • Delim: -
  • Mode: CONSTANT
  • Result: Messages sent between August 1, 2016 and August 30, 2016 will return true as the result.

Example 2 (dynamic calendar check): This type of range can be used with PidTagMessageDeliveryTime, for example.

  • Pattern: Age007000000;Age001000000
  • Delim: ;
  • Mode: CONSTANT
  • Result: Messages older than a day and younger than a week will return true as the result. Note also here that the lower bound is expressed differently here than for the other types - both calendar checks go from an earlier to a later date, but here the lower bound is a larger number.

Was this information helpful?

  • Yes
  • No


The captcha is not correct. Please check the code.

*Mandatory fields

  We do not reply to support requests sent through this form.
If you require assistance, contact your ELO partner or ELO Support.