How to select a row in a webtable using some column value as reference?

datatable
activities

#1

Hi,

I have an application where i need to pick a row in the webtable based on column value.
How can i do that using UI path?

below are the table headers and I Need to select the rows bases on status col value as ‘New’

Thanks,
Vishal Kumar


#2

Hi Guys.

Did any one has a solution ?

Thanks,
Vishal Kumar


#3

@vishal.kumar,

Extract the webtable using ExtractStructuredData activity and use following query,

Try DataRow[] dtrow = (Datatable Variable).Select("[ColumnName]=‘New’ ")

Suggest : You can find many solutions in the forum if just go through.

Regards,
Dominic :slight_smile:


#4

Hi Dominic,

Below is my xaml and selector i used is

when i write the output dt into excel, it is giving me error - Extract Data : Value cannot be null.
Parameter name: s I am not sure from where this error is coming

Thanks,
Vishal


#5

@vishal.kumar, Can you check the selector once more ? If possible can you share the Xaml File ? (If its not confidential)

Regards,
Dominic :slight_smile:


#6

Hi Dominic,

I am using the attached the CSV file. I need to get the rows with Owner Last Updated = Nobody in particular and write into an excel/word.

I am using the below filter on datatable to get the desired rows.
DataRow[] assignedTic=TicketInfoTable.Select("[Owner Last Updated]=Nobody in particular")

When i run this i am getting Syntax error: The items following the IN keyword must be separated by commas and be enclosed in parentheses.

Could you please help me on this

Thanks
Vishal kumar

testTicket.zip (883 Bytes)


#7

hey Dominic

I found out the answer. value should be enclosed in quotes

DataRow[] assignedTic=TicketInfoTable.Select("[Owner Last Updated]=‘Nobody in particular’")

Thanks,
Vishal Kumar


#8

@vishal.kumar, wishes bro !

Regards,
Dominic :slight_smile:


#9

Hey @599712,

Can you suggest a way to get all the filtered rows into doc or xls. I meant - Say, i have 10 rows with 6 columns and based on data table filter it matches only 3 rows and i need to get all the 3 rows along with 6 columns information into an excel or word. Any help for this ??

Thanks,
Vishal Kumar


#10

@vishal.kumar, Use following LINQ Query in Assign activity,

Assume,
dt - Your datatable with 10 rows and 6 columns
Column Name - Based on which column u filter
Value - Based on the value u filter

Datatable dtFinal = dt.AsEnumerable().Select("[Column Name]= ‘Value’").CopyToDatatable()

Now use this dtFinal datatable to write in excel.

Note: Let me know if u have any concern ! And you have many posts in forum with clean answers just refer it for more knowledge on this !

Regards,
Dominic :slight_smile: