Find specific row content from a datatable

Hi, I am trying to retrieve a specific cell content from a Datatable . Let’s say I have data as in below format:

|col 1|col 2|col 3|col 4|
|1|a|b|PDF|
|2|c|PDF|d|

I need to check- if the cell content is PDF and return boolean accordingly .And this cell can be in any row/column.

can you try this

dt.AsEnumerable.Any(Function (r) r.ItemArray.Any(Function (i) i.ToString.ToLower.trim.Contains("pdf")))

@muktadir where do i use this query

Use this query in an assign activity

blnPDFFound = dt.AsEnumerable.Any(Function (r) r.ItemArray.Any(Function (i) i.ToString.ToLower.trim.Contains("pdf")))

blnPDFFound is a boolean var

Hi @Leo_Hope

Read range workbook
For Each Row in dt
For Each column in dt.Columns
If row(column).ToString.Contains(“PDF”) Then
// Set a boolean variable to true or perform any other action
End If
Next
Next

Hope it helps!!

Thank you @muktadir.

Thank you @pravallikapaluri

1 Like

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