integrationnetsuiteemail-parsingboomi

Dell Boomi - Parse values from email body


I'm working with the Dell Boomi platform and NetSuite.

I have a unique situation where we need to retrieve emails from an inbox with a mail(IMAP) connector then take the body of the email and read it line by line to extract specific information.

Crude diagram of what I need This is a crude diagram of what I need to do.


The mail(IMAP) connector works perfectly, but I can't figure out what to do from there. I'm trying to learn Boomi and it's proving more of a challenge.

Basically I need to create 3 variables from the body of the email:

var customer = [];
var memo = [];
var amount = [];

The email body being parsed would look something like this with no headers:

-----Original Message-----

From: info@somesite.com

Sent: Wednesday, August 28, 2019 9:07 PM

To: reports@somesite.com;

Subject: Event Log: Report Recap Subject Line

Example 123456, 123412532452346346: ALKNBAQWIOET235QA08WSAQ2038YTQ12{

Example 120985, 109285710928561239: IO2Q0AIHJG698AE64A98GA654AG98DGF{

Example 489072, 987651498795654987: S54DGFH9A84D65F4A6SDF98A4SD138A4{

12341253643876843589, #12345, 100.00

12387019287654984616, #12324, 125.00

12359870923654987465, #51232, 100.00

This portion of the email is what I need to read from and ignore the rest

12341253643876843589, #12345, 100.00

12387019287654984616, #12324, 125.00

12359870923654987465, #51232, 100.00

I assume I would need a Data Process shape to manipulate the information. But I don't understand what scripting should be included to pull these into variables that can be connected to a map in a future step.

Crudely written, I need the script to do the following:

I'm sorry if this doesn't make much sense. I'm really hopeful that I can find help here though. I'm trying my best to learn this but it's just over my head, desperate, and I just need help...

My current process in Boomi, I have no clue what to do after this, again the email is pulling perfectly. current boomi process


Solution

  • One way to solve it would be to basically split the document by line, push it through a map and then evaluate whether the first column is greater than zero via a route. Skip the variables and just handled it via a map. This assumes you have some fundamental understanding of DellDoomi.

    Example: enter image description here

    Moving from left to right:

    1. "Test Data" - message with your example text so I could test.
    2. "Split Document - Flat File - Split By Line" - This would be where you'd start and connect this to your mail connector. It's a Data Process Shape, Split Documents enter image description here

    That will basically split your email message into individual documents per line.

    1. "Flat File" - This is a map. I manually created a new Flat File Profile(email message input), Comma Delimited with 3 Elements. This is bringing structure to each line. Source and target are using the same Profile, your right side would probably be the profile for netsuite, mapping the appropriate columns.

    enter image description here

    1. "Route" - This basically looks at the value in the first column and checks if it's greater than 0. Anything else gets routed to Default and we don't do anything with those. Routing by the first column of the "email message input" profile that had been created.

    enter image description here

    1. "The Greater than 0" branch would be where you hook up your destination. As this should only be those 3 lines as shown in your example since those are actually greater than zero.

    enter image description here