How to Select a Row in CV Table by Matching Text from a Variable?

Hi all,

I’m working with UiPath Computer Vision inside a CV Screen Scope, where I can extract table data using CV Extract Table.
I have a string variable, for example:

targetText = "832477"

I want to click a specific row in the CV table where one of the cells matches this variable.

Here’s what I tried so far:

  • Extracted the table using CV Extract Table into a variable “EncounterValue”.
  • Tried looping through the rows and checking row("EncounterValue").ToString = descriptorString
  • But I’m not sure how to pass that row element to CV Click so it clicks the exact cell or row.

Question:
Once I have the match, how can I pass it directly to CV Click without hardcoding the descriptor?

Any example workflow or snippet would be greatly appreciated!

Thanks in advance,
Praveen

By using below expression in assign activity you can get a table row

if you know column name
targetRow = dataTable.AsEnumerable().FirstOrDefault(Function(row) row("<ColumnName>").ToString().Trim() = targetText)

if you don’t know column name

targetRow = dataTable.AsEnumerable().FirstOrDefault(Function(row) row.ItemArray.Any(Function(cell) cell.ToString() = targetText))

For CV Click using variable check below links

Hi @Praveen_B

You can specify like below for your cv click activity(sample below) where anchor would specify the text “832477” from your variable.

“Target: TableCell (271,85,552,201)” +
“ColumnName: 12345 (420,85,398,26) Accuracy:0.95” +
“RowContains: Licence Class: (271,111,149,24) RowCell: 1” +
“Anchor: Text ‘“+target text variable goes here+”’ (400,53,174,14) Accuracy:0.95”

1 Like

Hi Sonali,
Thanks a lot for your detailed explanation and example. I tried your approach and it worked perfectly – I can now match the row based on targetText and click it dynamically without hardcoding the descriptor. Appreciate your help!

1 Like

Thank you for the quick response and guidance.

1 Like

@Praveen_B

Glad to know I could help :slight_smile:

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