UiPath: How to Extract Outlook Emails with Regex (Full Use Case)

preview_player
Показать описание
This video tutorial shows how to extract data out of an Outlook Email Body in UiPath with the help of Regex. We go through each step of the use case in detail, so open your UiPath and create your own RPA workflow.

0:00 Intro
Today we are again through a very cool UiPath RPA use case, where we use Regex to extract data out of Outlook emails and print it into Excel. Regex is a sequence of characters that defines a search pattern, is mostly used on structured data, and is a must-learn for any RPA developer.

1:37 Get Outlook Mail Messages and use a For Each

9:10 Save Outlook Emails to Excel
We create a Data Table to save our output into. For each email, we use an Add Data Row and add an array of date, subject, and body. Finally, we save the Data Table into an Excel sheet.

14:30 Extract data out of the email body with Regex
We use Regex101 to create our Regular Expressions. Regex is a series of characters that defines a search pattern. It's something you need to learn as an RPA developer and is often asked in RPA interview interviews. To apply Regex in UiPath we use the Matches activity (where we define the pattern and save the output to an IEnumerable of Matches, which you can see as a list).

24:15 Create a Dynamic Regex solution in UiPath
We create a Data Table with a row for each Regex pattern, we want to use in our email extraction workflow in UiPath. Afterward, we can loop through each pattern one by one and extract each thing one by one.

32:17 Move the processed emails
We move our emails one by one after we've processed them. In addition, we create a unique Excel sheet every time the robot runs, so we don't overwrite it. A best practice to create unique file names is using the date and time in milliseconds, since this is unique.

Connect with me:

#uipath #rpa #automation
Рекомендации по теме
Комментарии
Автор

Wow, Saw this at the point when i needed this exact solution. Thank you for the effort.

ayodejiosikoya
Автор

Hi Anders. Nice video. You should do a course on Regex. I learnt a lot from the little you gave us

MrMwenesi
Автор

Hi Anders, Thank you so much for this tutorial am searching for this like a week

krishnakanthsarma
Автор

Great use case which covers couple of more concepts 👍

supritpradhan
Автор

This is an awesome tutorial. Thanks for sharing

jakepaz
Автор

Great explanation! I like your content! However, I prefer doin this kind of stuff in C# (invoke code). Just a few lines of code instead of an entire screen ;). Anyway, thks for sharing ! Keep goin!

christianmarpert
Автор

Once again awasome video thank you so much ❤️🔥 🙏

joswadsouza
Автор

Wow!!! Thank you so much. You're the bestest!!

srushtikotangale
Автор

Hi Anders! Great video! When making the matches segment and write line ienMatches(0).Value, how would you do it if your email contained an unknown number of Case ID's? For example the email you were working on. How would you extract and print out an unknown number of Case ID's if every email contained more than one. Could be 1 but could also be 20? How can i then make it so it saves all 20 Case ID's to the excel sheet?

iTzRUNNR
Автор

Please create a video on "how we to write specific excel data table in outlook mail body using UiPath".

mjafrul
Автор

Great video! What does "ien" stand for in ienMatched(0) and why is it important?

trvelere
Автор

Great!! If there is keywords in mail then from that keywords you want raise ticket...can you please guide

dattaveeravalli
Автор

Hello Anders, i like your video. I would like to question if with this method I could read messages not structured of Outlook for example to extract date, keywords of subject and also of body of every one this messsages answered, forward, received and finally to copy the data to excel spreadsheet. Best, regards.

Message 1 date

Body

Message 2 date

Body

Message 3 date

Body

sandrabello-m
Автор

Hi Anders, a very great tutorial.

But I am kind of having difficulty to understanding on the following.

= ienMatches(0).Value

May I know what is the “0” value is referring to in dtRegex? I guess is the column “Name” in the dtRegex, but not sure is it correct, please enlighten.

Thanks :)

julieluo
Автор

Hello Anders, I’ll watch your videos which mostly solve my issues but I’m trying to extract the table data from an email outlook with regex how can I do that. I tried with front end but it’s kind of a complex process so thought of using regex to extract table data.

chil
Автор

Sir thank u for your solution but i cant extract from the body so can u plz help me ?

Montu
Автор

Hello Anders
Please help me!
I am automating web scraping.
I have the following problem: the site opens a new tab automatically. UIpath can open the new tab, but it returns automatically to the initial page (so, I cannot make clicks, etc on the page opened). I used the command Ctrl + Tab, but didnt work.
How can I solve this?

Francotujk
Автор

Hi Anders, thank you for the tutorial. Do you have any ideas on how to remove signatures from the e-mail body? Seems hard to do with Regex.

n.a.s
Автор

Hi Ander, would you please help why the output to excel on the body column was blank only? Thanks

tiffanytu
Автор

Hi, i am getting error in assign activity that "object reference is not set to an instance of object"when try to assign
Pls help me to resolve this issue....

riyasharma