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 ?
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...
May 31, 2022, 1:15pm
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
thanks, it was exactly what I needed
June 4, 2022, 7:13am
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.