I am using the following code to print this output,
filtered_dt.DefaultView.ToTable(True,“sap_code”)
DT from where I am brining the current output
Expected Output:
is it possible to get only the values except the column header or any way to cut off the column header?
Yoichi
(Yoichi)
February 28, 2023, 9:30am
2
Hi,
Which data type do you need as result?
If string type, the following will work.
strResult = String.Join(vbCrLf,dt.AsEnumerable.Select(Function(r) r("sap_code").ToString).Distinct)
Regards,
1 Like
ppr
(Peter)
February 28, 2023, 9:31am
3
a datatable will allways define a datacolumn along with its column name
Tanzill_Ahsan:
get only the values
depending on your outputting needs we can check for options on how to surpress it. Maybe you can elaborate more on this.
also have a look at this code statement.
strData =
String.Join(Environment.NewLine, filtered_dt.DefaultView.ToTable(True,“sap_code”).Select(Function (x) x(0)))
1 Like
it worked, thank you @Yoichi
1 Like
I want to input each of the value separately in a typeinto activity
rn, if I am inputting through the strresult all of the values are passing altogether, I am already insdie a for each DT loop with another DT
how may I input one after another and after inputting one value to typeinto I will input other data too, after completing all of the inputs I will go for second data then third…
Can you help me out once more? @Yoichi
Yoichi
(Yoichi)
February 28, 2023, 11:40pm
6
HI,
If it’s necessary to input them separately, it might be better to use not single string but array of string.
arrStr = dt.AsEnumerable.Select(Function(r) r("sap_code").ToString).Distinct
Then use type into with dynamic selector in ForEach
Regards,
1 Like
postwick
(Paul)
February 28, 2023, 11:57pm
7
If you’re trying to input each value separately into a Type Into, then you don’t do all this Join stuff.
You just For Each Row in Datatable and then within that you have your Type Into with CurrentRow(“sap_code”).ToString as the text to type.
@postwick in my CurrentRow the sap_code is not available, this is why I am facing issue to develop my usecase
facing this error while trying the assign activity
variable type I am using is, Array of String
Yoichi
(Yoichi)
March 1, 2023, 4:28am
10
Sorry, i had mistake. Expression in the above image is correct.Can you try to add .ToArray at the end of the expression.
arrStr = dt.AsEnumerable.Select(Function(r) r("sap_code").ToString).Distinct.ToArray
Regards,
1 Like
postwick
(Paul)
March 1, 2023, 2:33pm
11
You literally show it in your output.
system
(system)
Closed
March 4, 2023, 2:33pm
12
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.