Outlook mail ,to extract subject

condition 1: in outlook mail ,where my subject contains eg: invoice and some dates (14/07/2019),i need to extract the date alone.
condition 2 :sometimes i dont have dates in subject so i need to extract the current date (today).
please any one help on this

Hello,

You can use Regex to extract dates.
Lets say that your dates can come in dd/MM/yyyy or dd-MM-yyyy format, you can use Matches activity to extract only the date:

Since Matches returns value of IEnumerate you need to get its value like:

RegexResult(0).Value

@priyankavivek

To add to what has been posted above, use this regular expression to extract the date in format MM/dd/yyyy.

(((0)[0-9])|((1)[0-2]))(\/)([0-2][0-9]|(3)[0-1])(\/)\d{4}

This will return you the text, so you need to use Convert.ToDateTime(“your string extracted”).

For when this returns no value, use DateTime.Now.

how can i give it in if condition?

The true case means there was a date in the input text, which logs “yes”

i try with this thank you

fgsfgggggggggggg i need to be mentioning the mail id also

I don’t get it, if you mean you need to add one more condition, just use:

{your first condition: email} andalso {your second condition: date}

i need to get the subject from particular mail,but my output shows it fetches from other mails also.and my filter condition subject is like date+invoice
or invoice alone