Email rules: Extracting data

From Planfix
Jump to: navigation, search

Extracting data is the second block in the rules for processing emails, which you must fill out when creating a rule. Data is extracted into infoblocks. These infoblocks have intuitive names, making it easier to work with them later in the process when populating task, contact, or data tag fields. In addition to a name, each infoblock contains instructions for extracting the part of the email that should go into it:


Data extraction formats

When extracting data, there are two ways for Planfix to analyze an email:


  • As text — this usually corresponds to what you can see in your browser when you read the email. This is the most popular option.
  • As HTML — all email contents will be analyzed, including markup. This option allows you to use fragments containing HTML tags to more accurately capture the desired content.
  • JSON — used for parsing if the message text is in JSON. Read more about this in our JSONPath help section.

Data extraction methods

There are three data extraction methods available:


  • From label to end of line - the infoblock will contain the fragment of the email starting immediately after the label you specify and ending with a newline character or the end of the email. Leading spaces (if any) and the newline character will not be included in the infoblock.
  • From label to label - the infoblock will contain the fragment of the email starting immediately after the start label you specify and ending with the final symbol before the end label. Leading and trailing spaces will be ignored.
  • Regular expression - the infoblock will contain a fragment of the email according to a regular expression you input.


Let's say an email is sent to Planfix with the following body:


The configuration for the infoblock for extracting the customer's phone number from this email would be as follows:


Once this has been processed, an infoblock will be created called Phone, containing +75847842159.

To extract multiple lines from the order that are listed in the email, use the following setup:


Once this has been processed, three infoblocks are created with the following contents:

  • Product name: KC6 Clamp, U-System Clamp, N-P Adapter
  • Product price: 5,400, 150, 390
  • Number of products: 1, 5, 3

Later in the mail parsing rule, the main operation and additional operations will use these infoblocks to select tasks, contacts, and data tags and populate their fields with data. (For examples, see the corresponding help section articles.)

Go To