Sign in
    Shared Email Templates

    Extract data from datasets using regular expressions

    You can add regular expressions to simple or Excel-based datasets to find matching phrases in received Outlook emails. When a match is found, the add-in automatically inserts values from the corresponding dataset row into your reply.

    Step 1: Add the Regex Field and Regex columns to your dataset #

    1. Start editing your simple dataset.

    2. Click the down arrow next to the plus sign to the right of the last column and select Regex Field.

    3. Click the down arrow next to the plus sign again and select Regex.

    4. In the Regex Field column, select a field where you want to look for matching phrases: body, from, to, cc, bcc, subject, location, recipient first, last, or full name, or sender first, last, or full name.

    5. In the Regex column, enter your regular expressions.

      An example of a simple dataset with the Regex Field and Regex columns
    6. Select Save.

    Your dataset is ready, and you can use the data it contains in your replies.

    Step 2: Add the Insert macro to your template #

    Suppose you often receive emails with order IDs in the message body, and those IDs include a two-letter abbreviation of the country name, like “DE73491”. When replying to such an email, you’d like to check the message body for a specific abbreviation so you can automatically include relevant information from your dataset in your reply. To do this, you’ll need:

    • The Regex Field column in your dataset with the body option selected

    • Regular expressions covering the structure of order IDs in the Regex column, for example \bDE[0-9]{5}\b

    • The Insert dataset value option of the Insert macro in your template to bring the required details from the dataset to your reply, for example the country name and delivery period.

      A sample email template with dataset value placeholders

    When you reply using such a template to an email that contains an order ID with a two-letter country abbreviation, the country name and delivery period are automatically retrieved from the dataset and inserted into your reply.

    Placeholders replaced with dataset values in the message body after the template is inserted