Use fields functions to extract part of your data

Modified on Tue, 07 Jun 2022 at 10:11 AM

When you use data fields in different parts like saving email to a folder, or print email with fields, you can extract only a part of the data. That's useful when you have long string and want to get only a part like an email or an order number.


Example: You want to save email in a folder using the email unique id as part of folder or filename, but it is very long %22456464xcvrg4vcv@sgdcv12%, you want to keep only the last 4 digits so you can use the function: RIGHT(%EMAIL_ID%, 4).

The available functions are:


- LEFT(field,X) = extract the X number of characters from the start (for example LEFT("Order received from King of Flowers", 5) return "Order")


- RIGHT(field,X) = extract the X number of characters from the end (for example RIGHT("Order received from King of Flowers", 7) return "Flowers")


- MID(field,X,Y) = extract the Y number of characters from the X position (for example MID("Order received from King of Flowers", 6, 8) return "received")


- REGEX() = use regular expressions to extract data, this function is particular and requires some computer skills. For more information on RegEx please check these sites:

https://blog.usejournal.com/regular-expressions-a-complete-beginners-tutorial-c7327b9fd8eb

https://regexone.com/


Here some basic examples to use REGEX in the fields:
- Extract all numbers in the email subject field:
REGEX(%EMAIL_SUBJECT%,[0-9]+)

- Exclude the characters #: in the attachment filename:
REGEX(%FILENAME_FULL%,[^#])

- Exclude the characters FW: in subject of email:
REGEX(%EMAIL_SUBJECT%,[^FW:])





Use right function to extract data



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article