Jump to content
Sean Teehan

Create Variable from Email Content

Recommended Posts

Hi,

 

is there a way to create a variable to be injected into a custom field / BPM from the contents of an email.

 

Example - our HR system sends an email to HB for a starter / Leaver. The customer in HB is then the HR system. I want to be able to take the name or Employee number from the email body and automatically change the customer to that new starter / leaver.

 

Thanks,

Sean

Share this post


Link to post
Share on other sites

Hi Sean,

Thanks for your post.  While I haven't had a chance to test this, there may be away to achieve this within the BPM.  

Start with the Get Request Information Hornbill Automation node which will give you the content/body in a variable.  

image.png

 

I was then looking at the BPM Hornbill Automation string utility you may be able to use these options to find an employee number within the body.  There are a few other string functions, but I think that this is the one that may work.  I'm not completely sure of what to enter into the From and To boxes.  Normal Substring functions I believe will be looking for the number of characters from the beginning of the string where the substring starts for the Start option, and then the To option would be the number of characters.  (eg Input text =“The Dog”, From =5, To=2 and the Result variable would = “Do” ).  Sorry that I haven't had a chance to test.  Let me know how you get on.

image.png

Share this post


Link to post
Share on other sites

Thanks @James Ainsworth,

 

i have done a few tests and that appears to be working. I see there is a character limit tho. At first i was looking at From = 21 To = 6 and i was not getting the results back. After i changed it to From = 0 and To = 6 and it was pulling the information i needed in.

Do you know if there is a way to Prefix the outcome? i will need to add "EMP"to the obtained variable.

 

Thank you for your help 

Share this post


Link to post
Share on other sites

Hi Sean,

Great to hear that you have made some progress with this.  Once you have your variable, if you use this to update a request you can use a combination of the prefix+variable as seen in the screenshot.

image.png

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...