Filter is not working


#1

Hello Everyone,

I need a small help please. As I am working on Filter Column. I have an excel sheet and there is a column like ‘System Status’ and I need to filter that column like, System Status should be ‘REL’. So for that I have assigned ‘REL’ to a variable called ‘SystemStatus’ and then I created one more variable as strarrayrow as Datarow[] and assign it with dtoutput.Select(“SystemStatus = '”+SystemStatus+"’") where dtoutput is my datatable. But I am getting the error like, Missing operand after Status operator. Is there any space issue for column name header? And one more thing if once I get the output in datarow then how should I update it to my DataTable ? Thanks in advance.

Regards,
Hemal.


#2

Hey @hemal

kindly try this and let me know :slight_smile:

dtoutput.Select("[System Status] = '"+SystemStatus+"'")

Regards…!!
Aksh


#3

Hey thank you so much. Space should not be there as it is column name. Yes got it. Thanks again.
I just want a small help again. How should i get my updated Datatable after that.


#4

Well by using select statement with datatable it will return you a DataRow[ ] so you can use a for each iteration on this.

I think this link will help you on this:

Regards…!!
Aksh


#5

Hey @aksh

Thanks again. I read that link and i am doing same as though i am unable to take row item as in for each loop, it shows like, value of type ‘1-dimensional array of system. Data.datarow’ cannot be converted to 'System. Data. Datatable


#6

Use a normal ForEach and set the ArgumentType to DataRow (search the forums if needed, this has been mentioned a lot of times).

@badita - maybe it really is worthwhile to remove ForEachDataRow? It only adds confusion and is basically a single-case foreach anyway.


#7

@andrzej.kniola Thank you so much. Actually i am new to uipath and have wasted the whole day for this solution. Actually there is no conversion argument via for each row loop. And so that after your reply, I have set the argument as datarow and again i created the loop for itemarray. It is working perfectly!
Thanks again!

Regards,
Hemal


#8

We don’t have the time and the… courage :slight_smile:

On the other hand it is like in programming… when you start you’ll, for sure, get stuck with something. However, if you would get through the academy training and exercises, in the end, you’ll probably know the difference between forEachRow and forEach. My guess is that people will anyway get stuck in a normal forEach, no matter if we remove the particular forEachRow. I tend to believe that the solution is to provide an inStudio help about the activities that will guide you - “haah, you’re using for each, make sure you set the type argument!”.

For the time being and till we improve the UX the academy training makes sense for any beginner. You’ll waste some time, but better to waste it there then spending one day in trying to find a forEach solution.

:confused:


#9

Thanks for your quick reply @andrzej.kniola and @badita . As per you told i created for each loop (argument as datarow) and i am getting all the items from the. I have a small query like, how get update that datatable. I am trying to add as mydatatable.Importrow(itemarray) but not getting properly. Can you please help in that. Thanks in advance.

Regards,
Hemal


#10

Your Varible name.CopyToDataTable