Extract dynamic data from email form on loop

Ran into a problem. I receive automated emails that contain address changes (the dynamic data) and I want to extract that information to copy and past into our CRM. How do I get it to read the email and pull out the data I want? I can get it to work when I hard code the “assign mail” function with the data but I can’t get further than that.

@schaffer5510,

Could you please tell more details and do you want to read body of the mail ?

Here is an example of the standard email I get:

"Address ID: 123456

123 Main Street
Defaulttown, USA 54321

Client engagements linked to this address record as the primary mailing address:

Client Number: 121214
Engagement Name: Standard Engagement"

I want to read each email I get like that and extract the street address, city, state, zip and client number.

I have no issue extracting that text using System.Text.RegularExpressions.Regex.Match(Mail,“((?<=, ).*(?=54321))”).Value. My problem is below:

I don’t want to have to hard code that data in the expression editor, I want to create placeholders for the variables I want to pull through.

Perhaps there’s a better way to do this. Does any of this make sense?

@schaffer5510,

Try below one to read body of mail.

Mail.body.toString

@schaffer5510

Please find the attached implemented workflow.

Extract Email.xaml (11.0 KB)

This process works great for extract the address ID but how would I do the same thing with trying to extract the street address, city and state? Basically,
the part that doesn’t have text you could use as an anchor, aka you can pull data following “address id”. Does that make sense?

Additionally, that Address ID: 12345 will always change and never be the same so can you create a placeholder for that so it knows to pull data following that?

@schaffer5510

Please find the attached implemented sample.

It extracts each field dynamically.

AddressSplit.xaml (14.0 KB)

Please let me know if it is what you are talking about.

Thank you for the help but I don’t think that’s addressing what I need. Here is the sample email I receive:

Address ID: 52174

12345 E Main Street
Defaulttown, FL 54321

Client engagements linked to this address record as the primary mailing address:

Client Number: 120456
Engagement Name: Standard Engagement

What I’m trying to do is extract the Client Number, Street Address, City, State and Zip Code. Where I’m tripping up is that data is never the same, for example, the next email has a completely different address and client number. Is there something you can do with the string for place holders rather than having to put in the data of each specific email?

Extract dynamic email example.xaml (12.9 KB)

Please find the updated attached workflow.

AddressSplit.xaml (30.3 KB)

I assume values are changing but some labels remains constant like Address ID,Client Number

I see what you’re doing but how do I get that Str_Input to not have hard coded data in there? What I’m looking for is:

"Address ID: (##Variable##)

(##Street_Address##)
(##City##), (##State##) (##Zip Code##)

Client engagements linked to this address record as the primary mailing address:

Client Number: (##Client Number##)
Engagement Name: Standard Engagement"

Does that make sense? Each email that comes through will have different client numbers and street addresses.