How to extract HyperLink/s from each cell in a excel Datatable

blank output because it’s not matching your pattern

Can we have an example like how we want to extract
@bT_de

give some examples of what you want to extract exactly

Actually I see a mistake in this DatatableName.Columns(ColumnName).ToString.

The o/p is always column name only

you need to pass particular column values row by row??

use row(“YourColumnName”).ToString
pass this as a Input to matches input

Yes this actually give the column name
And if you want to iterate through each value in that column
Pass that datatable to a FOR EACH ROW activity as input and inside the loop use MATCHES activity and in the input property mention as row(“yourcolumnname”).ToString and the Regex expression you have currently
So that will we get the match for those values in each row

Cheers @bT_de

@Palaniyappan & @Pradeep_Shiv

I need to extract the Links from MailBody columns and add it as a new row just below the existing row and then i need to pick the link and do open browser.

some cell has multiple matching strings!
how are you handling those?

@Pradeep_Shiv - Actually this is a sample. There will be mutliple links in each cell but with unique link.

as i can see there are three links in 2nd row from there you want all three or anyone??

@PalaniyappanSeq_GetUnreadMail.xaml (25.2 KB)

@Pradeep_Shiv … Yea in the second row there are three same links.
But In real time there will be multiple links which are different from each other and i need to xtract all of them.

Hi @bT_de,

Here is an activity called “Get Hyperlink” and “Extract HyperLinks” in the below package that it extract the hyper link from excel

Regards
Balamurugan.S

change for each row type of argument string to Object linksList

instead of this FilteredDataTable.Columns(“Mailbody”).ToString
row(“MailBody”).ToString keep this

@Pradeep_Shiv
change for each row type of argument string to Object linksList - Sorry I don’t get this.

you are trying to print regex matched string right??
for that you are using for each loop and the type of argument you are using is String change it to Object

Hi @bT_de,

You can try this

image

  • Regular expresion: (?<URL>http\S+), result is saved into matches variable
  • Take first match: matches.FirstOrDefault, result is saved into match variable
  • Get text from group defined with regex: match.Groups("URL").ToString

I hope this can help you

when i try to run this program it showing error like this may i know the match variable is of what type …error:Assign: Object reference not set to an instance of an object.