Read parts from Outlook message with "Matches" activity (regex)

Hey folks,

I want to read specific information from Outlook mails with the Matches activity. I know that the match is working and I want to get that exact information from the mail and save it in a variable after the match to further work with this info. I used an Assign activity and tried with [name of the matches result].toString but what I get is some cryptic info: (System.Linq.Enumerable+d__97`1[System.Text.RegularExpressions.Match])

screenshot1

Is there a possibility to get the info as a string?

Thanks in advance :slightly_smiling_face:

1 Like

Hi @Katja

Matches returns a collection of datatype match. To get the first item, try

dateinname(0).value.tostring

yah thats possible buddy
you are almost done
–inside the for each loop next to this matches activity use FOR EACH activity and pass the output variable obtained from matches activity and change the type argument as system.text.regularexpressions.regex.match and change the variable name from item to match
–use a writeline activity like this
match.ToString
where match is the variable from for each

hope this would help you
Cheers @Katja

Hey @Palaniyappan,
I don’t quite get your solution, I’m afraid. I should put another for each in the existing for each?
And what activity should I use for passing the variable? Assign?
Could you please clarify - I am a little lost :flushed:

1 Like

thx @tmays…this does not work, unfortunately

Yes
The sequence would be like this
For each
Matches
For each
Writeline // this will display each value from matches activity
assign
So the sequence would be like this
—inside the current for each loop next to this matches activity use another FOR EACH activity and pass the output variable obtained from matches activity and change the type argument as system.text.regularexpressions.regex.match and change the variable name from item to match
–use a writeline activity like this
match.ToString
where match is the variable from for each

Cheers @Katja

Got it. It worked.
Thx a lot @Palaniyappan and @tmays :pray:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.