Hello,
I have to sort some Excel datas depending of a string value of one column.
Each cell of this column can be 14 differents string values.
I’m looking for a technique to avoid to use 14 “if” activities to check what is the current cell value. Any ideas ?
Hello @anon52976114 ,
You can use switch activity. In this activity you can create multiple case. Based on the case which you are passing the particular sequence will work.
But here in your case you are getting value from one excel and using that for sorting of an another excel ryt. Then you can use for each row in datatable to loop through the strings and use sort activity.
The Switch activity enables you to select one choice out of multiple, based on the value of a specified expression. By default, the Switch activity uses the integer argument, but you can change it from the Properties panel, from the TypeArgument...
ppr
(Peter Preuss)
May 31, 2022, 1:15pm
3
can you illustrate your case a little bit more as
the quoted part is unclear.
When the question is about to check if in a datatable is to check if a particular value is present under a particular column, we can do
dtDataVar.AsEnumerable.Any(Function (x) x(YourColNameOrIndex).toString.Trim.Equals("YourSearchString"))
and will return true or false
other wise we can use a switch or since newer time the else if as well
The UiPath Documentation Portal - the home of all our valuable information. Find here everything you need to guide you in your automation journey in the UiPath ecosystem, from complex installation guides to quick tutorials, to practical business...
thanks, it was exactly what I needed
1 Like
system
(system)
Closed
June 4, 2022, 7:13am
5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.