|
Data points extract information from an incoming email that matches an email handler. You configure data points differently depending on the format of the incoming email message—as key-value pairs or as regular expressions. After you define data points, you can use them as variables in handler actions. |
If email messages that match this handler will contain data structured as key-value pairs—such as data from a web form—you must identify the keys to extract the matching values as data points.
Configure the settings for the value you want to extract.
Field | Description |
---|---|
Key | Enter the key name as it will appear in the email message. For example, if the email will contain a key-value pair such as |
Description | Enter a brief description of the extracted value. |
Is this a Date or Time? | Select the check box if the value is a date or time, and then indicate the expected format. See Defining the Date or Time Format. |
If email messages that match this handler will contain free-form text, you must define regular expressions to extract keywords and phrases as data points.
Click the Data Points tab, and then do one of the following:
In the Define a Data Point section, configure the following settings.
Field | Description |
---|---|
Name | Enter a name for the information you want to extract. |
Description | Enter a brief description of the extracted value. |
How many results will this Data Point return? | If the regular expression will match more than one value in the email, select true , and then indicate the number of expected matches. The add-on will store each matching value as an item in an array. For example, if the email will contain the start time and end time for a maintenance window, you can enter 2 , and then define a regular expression that looks for the time pattern. |
Is this a Date or Time? | Select the check box if the value is a date or time, and then indicate the expected format. See Defining the Date or Time Format. |
In the Create Regex Expression section, define patterns to find the value you want to extract.
In the Initial Regex column, enter the regex for the entire pattern you are looking for.
The add-on supports the standard JavaScript syntax for regular expressions. To test your regexes, you can use online tools such as regexr.com and regex101.com. |
Invoice #123456
, you can use a nested regex to extract only the number itself as the value of the data point. In this example, the initial regex would be ^Invoice\W#\d{6}$
, and the nested regex would be ^\d{6}$
. If you don’t enter a nested regex, the entire initial regex is used as the value. To add another regular expression, click the plus sign, and then repeat steps a – d.
The handler evaluates the regexes in order. If it does not find a match for the first regex, it will evaluate the next regex for a match. The handler stops evaluating subsequent regexes as soon as it finds a match in the email message.
This feature allows you to handle differences in formats for the same type of information. For example, an invoice number may be formatted as Invoice #123456 or Invoice #:123456, depending on the sender of the email. Likewise, you may have multiple number formats for invoices from different vendors. |
If the value you are extracting is a date or time, you must specify how the value will be formatted in the email message.
MM/dd/yyyy
for dates formatted such as 10/21/2006
. For a complete list of supported formats, see Java Documentation - Customizing Formats.