Hi @bpt.teja1996
I created new regex for extract data from your email.
I changed the condition from deleting all text from the new line to delete all text(including specifying message) after found a specific message.
for details please see as below:
User corp IDs (semicolon separated):
Regex.Replace(Regex.Replace(System.Text.RegularExpressions.Regex.Match(item.body.ToString,"(?<=User corp IDs [(]semicolon separated[)]:)[\s\S]*").ToString, "(?=User First and Last names [(]semicolon separated[)]:)[\s\S]*", "").ToString,"^\s","").tostring
New approver corp ID:
Regex.Replace(Regex.Replace(System.Text.RegularExpressions.Regex.Match(item.body.ToString,"(?<=New approver corp ID:)[\s\S]*").ToString, "(?=New approver First and Last name:)[\s\S]*", "").ToString,"^\s","").tostring.Split("\".ToArray)(1).ToString
Choose new costcenter:
Regex.Replace(Regex.Replace(System.Text.RegularExpressions.Regex.Match(item.body.ToString,"(?<=Choose new costcenter:)[\s\S]*").ToString, "(?=New location:)[\s\S]*", "").ToString,"^\s","").tostring
Requestor Name:
Regex.Replace(Regex.Replace(System.Text.RegularExpressions.Regex.Match(item.body.ToString,"(?<=Requestor Name:)[\s\S]*").ToString, "(?=Requestor mail ID:)[\s\S]*", "").ToString,"^\s","").tostring
Date of change:
Regex.Replace(Regex.Replace(System.Text.RegularExpressions.Regex.Match(item.body.ToString,"(?<=Date of change:)[\s\S]*").ToString, "(?=Selected option: User management)[\s\S]*", "").ToString,"^\s","").tostring
=================================================
Condition for email from yesterday
Please try to set Mail Filter by below condition: β[ReceivedTime]>='"+now.AddDays(-1).ToShortDateString+"'"+"AND [ReceivedTime] <= '"+now.ToShortDateString+"'"
And try to put [if] in for each mail list and set below condition to find mail subject βHR Change request for Clarityβ
If Condition:
item.Subject.Contains(βHR Change request for Clarityβ)
I hope this information will be useful for you 