Kelvin Posted May 30 Share Posted May 30 I am trying to process an automated email into a ticket. So far I can get the ticket to be logged and the body of the email posted into the Description field. Example of data First name: A Last name: Smith Department: xray Job Role: Clinical Nurse Specialist The part I am struggling with is dissecting the content into custom fields. I run a Hornbill automation to get Source Email Details Hornbill automation -> string utilities -> Regex Substring (also tried Match) with the Variable set to "&[global["flowcoderefs"]["getEmailInformation"]["content"]]" and the Expression as (?<=Last name:\s)(.*)/m Hornbill automation to save the information in custom_a ("result") & _b ("outcome") These give me a true/false and un/success I have run this through a couple of the regex generators online and they always highlight the intended string so I know the code is finding the correct information. Can anyone suggest how I might get the actually content. Thanks in advance Link to comment Share on other sites More sharing options...
Victor Posted May 30 Share Posted May 30 @Kelvin (?<=Last Name\: ).* And then use the "result" param. EDIT: By the way, this assumes the plain text version of the email body is as you shown above... to check this, navigate to the email, top right hand side, switch to text format and see how the email looks like... Link to comment Share on other sites More sharing options...
Kelvin Posted May 30 Author Share Posted May 30 19 minutes ago, Victor said: @Kelvin (?<=Last Name\: ).* And then use the "result" param. @Victor Thanks for the prompt response That doesn't seem to work, Regex Substring (?<=Last Name\: ).* - Flowcode Error Regex Match (?<=Last Name\: ).* - Result - False My previous expression will run on both Regex and just returns True (?<=Last name:\s)(.*) - Result = True Link to comment Share on other sites More sharing options...
Kelvin Posted May 30 Author Share Posted May 30 (?<=Last name:).* gets a Result - True but still not the actually characters. Also checked and this using the text format. Link to comment Share on other sites More sharing options...
Victor Posted May 30 Share Posted May 30 @Kelvin sorry didn't notice the lettercase for "name", since the expression is case sensitive... try the below (tested in my instance and works fine) (?<=Last name\: ).* Link to comment Share on other sites More sharing options...
Kelvin Posted May 30 Author Share Posted May 30 42 minutes ago, Victor said: @Kelvin sorry didn't notice the lettercase for "name", since the expression is case sensitive... try the below (tested in my instance and works fine) (?<=Last name\: ).* @Victor Still getting false. Is there any chance you could put a screen shot of the node just in case I have something wrong. Link to comment Share on other sites More sharing options...
Victor Posted May 30 Share Posted May 30 @Kelvin Link to comment Share on other sites More sharing options...
James Ainsworth Posted May 30 Share Posted May 30 It might be worth considering adding one or more of these options under the Regular Expression Flags. 'i': Case-insensitive search 'g': Global search (finds all matches in the input string) 'm': Multiline search For example... Link to comment Share on other sites More sharing options...
James Ainsworth Posted May 30 Share Posted May 30 If this same node has been used while trying multiple configurations in attempt to getting this working, provided that you are happy with what needs to be added to the different options, try deleting the node and start with a fresh node. Link to comment Share on other sites More sharing options...
Kelvin Posted June 3 Author Share Posted June 3 @Victor @James Ainsworth Thank you both for your help on this. So I have managed to get this working if I use the Description field as the input text. I seem to only get True/False if I use the email body. I am happy to use it this way and use a node to update the fields as required. Link to comment Share on other sites More sharing options...
Kelvin Posted June 3 Author Share Posted June 3 @Victor @James Ainsworth This is now working really well however I have 1 hopefully small issue. If I run multiple nodes and one is left blank it return the value in held in "&[global["flowcoderefs"]["stringUtilsRegexSubstr"]["result"]]" is there a simple way to clear this. Link to comment Share on other sites More sharing options...
Steve Giller Posted June 3 Share Posted June 3 Without seeing the configuration of each node I can't be sure, but my gut reaction is to say that you should ensure that every "Find Information" node has a unique Result Reference field and the corresponding "Save [value]" node uses the correct variable. Link to comment Share on other sites More sharing options...
Kelvin Posted June 3 Author Share Posted June 3 16 minutes ago, Steve Giller said: Without seeing the configuration of each node I can't be sure, but my gut reaction is to say that you should ensure that every "Find Information" node has a unique Result Reference field and the corresponding "Save [value]" node uses the correct variable. @Steve GillerThanks, I wasn't sure if I could uniquely name the "Results" variable name. I will do that as it will help in future identify any variables. Link to comment Share on other sites More sharing options...
Kelvin Posted June 3 Author Share Posted June 3 . Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now