Hi All ,
I am trying to get a variable - assign it to a generic value and then use that in the select statement , is this doable in Uipath.
Thanks
Hi All ,
I am trying to get a variable - assign it to a generic value and then use that in the select statement , is this doable in Uipath.
Thanks
yes.
dataTable.Select(“Age>=”+dt1 ) or dt1.ToString
Did you check Add header in read range?
I did the add headers and specified the range
Check for any space and remove in Excel header for Age column
Changed the Type argument and its not throwing an error
Hi Guys,
I have the below error, when trying to filter using select statement as below,
dt2.Select(“Month =”+“'”+month+“'”+" AND TranType =“+”‘“+tranType+”’“+” AND LineCat =“+”‘“+lineCat+”’“+
" AND Total Count =”+“'”+totalCount+“'”+" AND Total Amount =“+”‘“+totalAmount+”’")
ERROR:
Message: Syntax error: Missing operand after ‘Count’ operator.
Source: Assign
Exception Type: SyntaxErrorException
System.Data.SyntaxErrorException: Syntax error: Missing operand after ‘Count’ operator.
at System.Data.ExpressionParser.Parse()
at System.Data.DataExpression…ctor(DataTable table, String expression, Type type)
at System.Data.DataTable.Select(String filterExpression)
at lambda_method(Closure , ActivityContext )
I’m assuming because of a space between the column header value “Total Count” & “Total Amount” columns,
Any help is appreciated,
Thanks.!
Well @Dilli
just use like that and let me know
dt2.Select("Month ="+"'"+month+"'"+" AND TranType ="+"'"+tranType+"'"+" AND LineCat ="+"'"+lineCat+"'"+" AND [Total Count] ="+"'"+totalCount+"'"+" AND [Total Amount] ="+"'"+totalAmount+"'")
Regards…!!
Aksh
It works like a charm mate. So it’s these braces needed if the header name has a space between words. Isn’t it ? Thanks.!
Yes
how to convert generic value variable into String datatype
i have scenario were i have to apply if condition on database column name “State” and value for this column would be “open”.
So i used Get Row item to get State column data, after that using if condition like State=Open the it is giving me error like below
I was getting the exact same error as saivig:
For me the solution turned out to be a syntax issue: an extra set of single apostrophes was needed. I was able to filter by columns that had variables of Int32 Type in the format shown above when filtering rows in the table, but every time I tried to filter on a Text Type variable column I’d get the “column not found” error.
dataTable.Select(“author = '
” + authorName.ToString +“'
”)
Hi,
Regarding the syntax, can I replace the column-header with column-index, and how ?
Thanks
.Select
doesn’t support it, but you can work around by using dt.Columns(yourIndex).ColumnName
instead of a hardcoded column name.
Hi @andrzej.kniola,
Thanks, I think I am close to it but still got the error. The expression contains undefined function call DT.Columns()
The column I want to compare with the string variable is Column 0. My syntax is:
DTSelect(“DT.Columns(0).ColumnName = '”+string variable+“'”).CopyToDatatable
Where did I make the mistake ?
A typo on the syntax, it should be:
DT.Select(“DT.Columns(0).ColumnName = '”+string variable+“’”).CopyToDatatable