Support Portal

for ProcessRobot and WinAutomation

Start a new topic
Answered

parse gmail email

 how do I read the content of a gmail email which I have retrieved in winautomation?


Best Answer
Parse: %RetrievedEmails[0].BodyText% Find as regex: (?<=: ).+ That uses a positive look-behind for any text containing sequentially ": " and matches any character, denoted with the ".", between 1 and infinity times, denoted with the "+". Take those matches, stored in %Matches% by default, and Launch Excel then Write to Excel. Check out SQL Actions and tutorials to find more efficient ways of working with Excel data. There are a lot of really good regex tutorials out there too and this is pretty basic. Good luck!

ADMIN

Hello Paul,


Note that once you retrieve an email with WinAutomation, it is saved as a variable.

You can then use that variable to access certain properties of the email.


For example, lets say you use the "Retrieve Emails" action and you save the emails into the %RetrievedEmails% variable. Then, the %RetrievedEmails[0]% will contain the first retrieved email (if any).


In order to access the body of that email, you can refer to it using the syntax:

%RetrievedEmails[0].Body%.


You can find all the available properties for a variable by double clicking on the value of that variable in the "Variables" pane within the Process Designer.


Specifically for the email variable, the available properties are:


image



2 people like this

Thank you. I have done that but my email body has data like:


Windows id: u678999

password: qwerty


how do I split the above content to get the values on the right side of the delimiter (:) and store in an excel file?

Answer
Parse: %RetrievedEmails[0].BodyText% Find as regex: (?<=: ).+ That uses a positive look-behind for any text containing sequentially ": " and matches any character, denoted with the ".", between 1 and infinity times, denoted with the "+". Take those matches, stored in %Matches% by default, and Launch Excel then Write to Excel. Check out SQL Actions and tutorials to find more efficient ways of working with Excel data. There are a lot of really good regex tutorials out there too and this is pretty basic. Good luck!
Login or Signup to post a comment