E-mail filter and usage of Find regular expressions

Hi,

I have managed to use Regex to read different data from certain emails and set Values with them. I have not been able to use the "Find regular expressions" feature.

The following works:

When I try following:

This do not work:

I would like to combine a couple of Regex results to one string and update the Title for a request, is this possible?

 

 

RE: E-mail filter and usage of Find regular expressions

Hi Johan,

There are different usages for these two features on Email filters.

Find regular expressions will allow you to create variables that you are able to fetch in CRMScript connected to Email filter with using method getVariable("<variableName>"), from your example; getVariable("myTest1").

 

By: Michel Krohn-Dale 16 Sep 2019

RE: E-mail filter and usage of Find regular expressions

Hi Michael,

Thanks for quick reply, that explained why I did not get it to work. I would need to learn EjScripting to combine regex results from emails?

I would like to make a better Title based on 2-3 different texts in the email.

By: Johan Friberg 16 Sep 2019

RE: E-mail filter and usage of Find regular expressions

Hi Johan,

To be able to do more advanced logic than is possible in GUI you need to be able to have some basic knowledge about CRMscript.

Some example code based on your Find regexp;

String ticketId = getVariable("ticketId");
String var1 = getVariable("myTest1");
String var2 = getVariable("myTest2");

//Load Ticket and manipulate title
Ticket ticket;
ticket.load(ticketId.toInteger());
ticket.setValue("title", var1 + " " + var2);
ticket.save("Update ticket title");

Also sidenote that if you are using a CRMscript connected to Email filter, you can also do your regexp on message content inside script.

 

By: Michel Krohn-Dale 17 Sep 2019

RE: E-mail filter and usage of Find regular expressions

Just a side note, at least I had to use getParserVariable to get values from variables. GetVariable always returned empty string in my environment when used with "Find regular expressions".

By: Mikko Tillikainen 8 Oct 2019

RE: E-mail filter and usage of Find regular expressions

You need to use setParserVarable("ordernummer", "123"); in the Mailbox event, execute before message is saved as well to be able to use later in the Mailbox event, execute after message is saved for example.

But I cannot figure out how to se these varaibles when setting values on the request or adding links.

I have tried tons of different combinations.

 

By: Gustaf Cullin 24 Oct 2019