How to append string to array variable

Hi Guys,

I have existing array , i need to add new string into the existing array.

for example,
Arrlist={“abc”,“gdf”, “jjj”}

Arrlist is array

i have add to one IF condition once condition true automatically add the new string “fff” to Arrlist
like
Arrlist={“abc”,“gdf”, “jjj”,“fff”}

Please anyone help.

Regards,
Raja G

@Raja.G You can use Arrlist.Append(“fff”)

You would have to use it in an Assign Activity in this way :
Arrlist = Arrlist.Append(“fff”).ToArray

3 Likes

@supermanPunch,

I have used your logic ,but its not working , never going to append

Hi @Raja.G

As per i know Array is of static length.
So how can new variable be added to that array ?

I will suggest that make it as list and then add the string to the same list and then convert that list to array.

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

Hi Pratik,

I have spend more time ,can u tell its possible??, how to make dynamic array its possible??

grafik
but its better to work on lists for such tasks

3 Likes

@Raja.G What was the error you got ? You might consider using list instead of Array though :sweat_smile:

@supermanPunch,

I am not using list, i have using array only,
shall i add list in this code,any suggestion please,

my code like below,

Input dialog option array {Existing Array} like {“aa”,“bb”,“cc”}
If condition once true
Arrlist.append(stringveriable).ToArray

I couldn’t able to add new string veriable in Array

@Raja.G What was the Error :sweat_smile: Can you show a Screenshot of how you have used it in the workflow?

@supermanPunch Error not shown , once IF condition true working fine but string not to be add in Array

@supermanPunch,

This is sample code below,

My expectation add string to array in dropdown list input dialog box once condition true

Please help anyone to resolve.

Main.xaml (7.5 KB)

@Raja.G
Main.xaml (7.5 KB)

Arr.Concat({Hello}).ToArray did as mentioned above the concatenation
displaying the Array content was done with help oj String.Join(“,”, Arr)
grafik

1 Like

@ppr,

Thanks its working fine , message box showed correct output ,i have another doubt,once done execution,
Again i am going run then automatically add in new string “Update” in Arr “Input dialog box” dropdown, if its possible??

Please help this

Regards,
Raja G

didd’t get you. Can you describe more on detail?

@ppr,

Once string(“update”) add to the Array , After that string(“update”) automatically come to dropdown of input dialog box array

1 Like

@Raja.G Are you using an RE Framework ?

@supermanPunch,

no i am not using reframework, i am using studio

@Raja.G Can you use that Input Dialog Activity After If Condition Activity and Check? If you want to Save the Updated Array each time you run the workflow then you would need it to be updated in a text file or Excel file. Then we can retrieve each time the contents from Excel and pass it as Array to the Input Dialog. In that way you can be able to See the Updated Input Dialog everytime you’ll be able or it is not possible to do so :sweat_smile:

1 Like

@Raja.G Check this Workflow :
UpdateArray.zip (1.8 KB)

1 Like

@supermanPunch,

Thanks man, i have another doubt, how to pass excel array to input dialog box array dropdown,

Please help this