Array of strings as a data table column

Hi everybody,

I have a Build Data Table activity and one of the columns should store an array of strings. See example below.

image

Could you please help me with proper syntax for this field. I tried
{“1”,“2”}
“1”,“2”
1,2
but it does not work.

Best regards,
Anatoly

Try to save your String as a variable then assign that variable in the datatable column.

String myVal = {“1”,“2”,“3”}

Now have this variable in the DataTable column instead of value

1 Like

Thank you, I did as you said, it lets me put the myVal value in String column, but when I close the activity it just disappears

Anybody had same problem?

@Ancher See this just what you need -

Main.xaml (7.0 KB)

Hi, thank you, could you please explain how it should work? I tested it but I do not see how it can help with my issue. I need to have an array of strings assigned to one datatable column.

Hi @Ancher

It seems like you cannot initialize the data table with the value of array of string.

Have you tried passing your array to the data table via an Assign activity? I am not sure, but it might work this way.

See your problem was you were not able to insert array in column now that we have inserted the array, how do you want to retrieve? See the attached sample in which I have inserted an array of strings {“1”,“2”,“3”} in data table, then retrieved the same in for each row of data table -

Main.xaml (10.7 KB)

1 Like

Thank you for your input, however I cannot run it, an activity seems to be missing, can you please confirm which one you have as the last step?

Another question, could you please explain where do you insert {“1”,“2”,“3”}, I cannot find it in the properties.

Thats strange after Add Data Row I have used For Each Data Table loop and passed read arrayString by Get Row Item like this -

Then use simple for each to extract array value like this

image

which outputs result as 1,2,3 which was in array like this

image

Just reproduce what I have attached in screenshot at your end this will work Im sure and if you need any help let me know

@Ancher
@PrankurJoshi

Could you specify which versions of the Studio are you using? I am pretty sure some packages are different between the stable 2018.2.3 and the beta 2018.3.

I tried once to open a workflow in stable 2018.2.3 that was earlier converted to beta 2018.3 and it would display similar error for some activities (the packages are not matching)

I am sure are some differences but he can install packages. However I am using beta

I am on 2018.2.3

Just to be sure, I tested the solution of prankurjoshi and it works :slight_smile:

As to the missing activity, I can be wrong here, but I think that you cannot install the new packages from beta for your stable release. They did a split of some activities in those packages and I think the stable release does not understand the beta ones :slight_smile:

See here for some more context:

Dependencies per Project
(…)
For each new project there are 4 default dependencies: UIAutomation, System, Excel and Mail. UIAutomation and System packages are formerly known together as CoreActivities package. We decided to split and decouple .

I am pretty sure I tested it and I got the same activity missing on a workflow that went from Stable to Beta and then was opened in Stable again.

1 Like

@Ancher
@PrankurJoshi
Thank you! It works! One thing though, I was hoping there is a way I could use Build Data Table activity to store and update values (pretty much as a config file). Which works perfectly fine with Strings, I can see them, but Arrays are not visible.

1 Like

I believe it to be a limitation of the Build Data Table activity. I think it is able to only initialize the basic types and the Array of String is probably not supported.

1 Like

@Ancher
@PrankurJoshi

Guys, one more thing, maybe you know how to get a random value from the array?

HI @loginerror,

Array of string value to Data table, Refer the below xaml file

ArrayToDataTable.xaml (11.6 KB)

4 Likes