# How to append string to array variable

**URL:** <https://forum.uipath.com/t/how-to-append-string-to-array-variable/241456>\
**Category:** Certification\
**Tags:** question, studio, system, uiautomation, activities\
**Created:** [July 28, 2020, 1:23pm UTC](https://forum.uipath.com/t/how-to-append-string-to-array-variable/241456 "2020-07-28T13:23:38Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raja.G](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/raja.g/32/254554_2.png) [@Raja.G](https://forum.uipath.com/u/Raja.G)\
**Post date:** [July 28, 2020, 1:23pm UTC](https://forum.uipath.com/t/how-to-append-string-to-array-variable/241456/1 "2020-07-28T13:23:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![supermanPunch](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/supermanpunch/32/133652_2.png) [@supermanPunch](https://forum.uipath.com/u/supermanPunch)\
**Post date:** [July 28, 2020, 1:27pm UTC](https://forum.uipath.com/t/how-to-append-string-to-array-variable/241456/2 "2020-07-28T13:27:13Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![Raja.G](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/raja.g/32/254554_2.png) [@Raja.G](https://forum.uipath.com/u/Raja.G)\
**Post date:** [July 28, 2020, 4:26pm UTC](https://forum.uipath.com/t/how-to-append-string-to-array-variable/241456/3 "2020-07-28T16:26:34Z")

</div>

@supermanPunch,

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

---

<div class="post-metadata">

**Author:** ![Pratik\_Wavhal](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/pratik_wavhal/32/160434_2.png) [@Pratik\_Wavhal](https://forum.uipath.com/u/Pratik_Wavhal)\
**Post date:** [July 28, 2020, 4:29pm UTC](https://forum.uipath.com/t/how-to-append-string-to-array-variable/241456/4 "2020-07-28T16:29:18Z")

</div>

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 🙌

Best Regards  
Er Pratik Wavhal 🤖👨🏽‍💻 💻

---

<div class="post-metadata">

**Author:** ![Raja.G](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/raja.g/32/254554_2.png) [@Raja.G](https://forum.uipath.com/u/Raja.G)\
**Post date:** [July 28, 2020, 4:35pm UTC](https://forum.uipath.com/t/how-to-append-string-to-array-variable/241456/5 "2020-07-28T16:35:16Z")

</div>

Hi Pratik,

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

---

<div class="post-metadata">

**Author:** ![ppr](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ppr/32/464097_2.png) [@ppr](https://forum.uipath.com/u/ppr)\
**Post date:** [July 28, 2020, 4:36pm UTC](https://forum.uipath.com/t/how-to-append-string-to-array-variable/241456/6 "2020-07-28T16:36:27Z")

</div>

![grafik](https://global.discourse-cdn.com/uipath/original/3X/6/d/6d2848b63a1fd61cf5fe44b722c966b01d5184e0.png)  
but its better to work on lists for such tasks

---

<div class="post-metadata">

**Author:** ![supermanPunch](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/supermanpunch/32/133652_2.png) [@supermanPunch](https://forum.uipath.com/u/supermanPunch)\
**Post date:** [July 28, 2020, 4:36pm UTC](https://forum.uipath.com/t/how-to-append-string-to-array-variable/241456/7 "2020-07-28T16:36:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Raja.G](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/raja.g/32/254554_2.png) [@Raja.G](https://forum.uipath.com/u/Raja.G)\
**Post date:** [July 28, 2020, 4:59pm UTC](https://forum.uipath.com/t/how-to-append-string-to-array-variable/241456/8 "2020-07-28T16:59:32Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![supermanPunch](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/supermanpunch/32/133652_2.png) [@supermanPunch](https://forum.uipath.com/u/supermanPunch)\
**Post date:** [July 28, 2020, 5:28pm UTC](https://forum.uipath.com/t/how-to-append-string-to-array-variable/241456/9 "2020-07-28T17:28:22Z")

</div>

> [@supermanPunch](#):
>
> What was the error you got

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

---

<div class="post-metadata">

**Author:** ![Raja.G](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/raja.g/32/254554_2.png) [@Raja.G](https://forum.uipath.com/u/Raja.G)\
**Post date:** [July 28, 2020, 5:36pm UTC](https://forum.uipath.com/t/how-to-append-string-to-array-variable/241456/10 "2020-07-28T17:36:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Raja.G](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/raja.g/32/254554_2.png) [@Raja.G](https://forum.uipath.com/u/Raja.G)\
**Post date:** [July 28, 2020, 5:47pm UTC](https://forum.uipath.com/t/how-to-append-string-to-array-variable/241456/11 "2020-07-28T17:47:41Z")

</div>

@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](https://forum.uipath.com/uploads/short-url/1CwBcMVztStmi3YgVgS5sC9o0Ri.xaml) (7.5 KB)

---

<div class="post-metadata">

**Author:** ![ppr](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ppr/32/464097_2.png) [@ppr](https://forum.uipath.com/u/ppr)\
**Post date:** [July 28, 2020, 6:19pm UTC](https://forum.uipath.com/t/how-to-append-string-to-array-variable/241456/12 "2020-07-28T18:19:26Z")

</div>

@Raja.G  
[Main.xaml](https://forum.uipath.com/uploads/short-url/so6bh8HLoOzgyIT9j1IsTct7TmM.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](https://global.discourse-cdn.com/uipath/original/3X/e/c/ec7a3a14bf047dd09141aa9e03ee6246b708b0d7.png)

---

<div class="post-metadata">

**Author:** ![Raja.G](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/raja.g/32/254554_2.png) [@Raja.G](https://forum.uipath.com/u/Raja.G)\
**Post date:** [July 28, 2020, 7:04pm UTC](https://forum.uipath.com/t/how-to-append-string-to-array-variable/241456/13 "2020-07-28T19:04:26Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![ppr](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ppr/32/464097_2.png) [@ppr](https://forum.uipath.com/u/ppr)\
**Post date:** [July 28, 2020, 7:05pm UTC](https://forum.uipath.com/t/how-to-append-string-to-array-variable/241456/14 "2020-07-28T19:05:50Z")

</div>

> [@Raja.G](#):
>
> Again i am going run then automatically add in new string “Update” in Arr “Input dialog box” dropdown, if its possible??

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

---

<div class="post-metadata">

**Author:** ![Raja.G](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/raja.g/32/254554_2.png) [@Raja.G](https://forum.uipath.com/u/Raja.G)\
**Post date:** [July 29, 2020, 1:58am UTC](https://forum.uipath.com/t/how-to-append-string-to-array-variable/241456/15 "2020-07-29T01:58:18Z")

</div>

@ppr,

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

 ![Dropdown](https://global.discourse-cdn.com/uipath/original/3X/e/8/e8bd9894ae233381da47eb2acad66de09bf23e7e.png)

---

<div class="post-metadata">

**Author:** ![supermanPunch](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/supermanpunch/32/133652_2.png) [@supermanPunch](https://forum.uipath.com/u/supermanPunch)\
**Post date:** [July 29, 2020, 4:38am UTC](https://forum.uipath.com/t/how-to-append-string-to-array-variable/241456/16 "2020-07-29T04:38:41Z")

</div>

@Raja.G Are you using an RE Framework ?

---

<div class="post-metadata">

**Author:** ![Raja.G](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/raja.g/32/254554_2.png) [@Raja.G](https://forum.uipath.com/u/Raja.G)\
**Post date:** [July 29, 2020, 4:41am UTC](https://forum.uipath.com/t/how-to-append-string-to-array-variable/241456/17 "2020-07-29T04:41:28Z")

</div>

@supermanPunch,

no i am not using reframework, i am using studio

---

<div class="post-metadata">

**Author:** ![supermanPunch](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/supermanpunch/32/133652_2.png) [@supermanPunch](https://forum.uipath.com/u/supermanPunch)\
**Post date:** [July 29, 2020, 4:45am UTC](https://forum.uipath.com/t/how-to-append-string-to-array-variable/241456/18 "2020-07-29T04:45:11Z")

</div>

@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 😅

---

<div class="post-metadata">

**Author:** ![supermanPunch](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/supermanpunch/32/133652_2.png) [@supermanPunch](https://forum.uipath.com/u/supermanPunch)\
**Post date:** [July 29, 2020, 4:54am UTC](https://forum.uipath.com/t/how-to-append-string-to-array-variable/241456/19 "2020-07-29T04:54:53Z")

</div>

@Raja.G Check this Workflow :  
[UpdateArray.zip](https://forum.uipath.com/uploads/short-url/hVEeYB9sOfbjkSERcS5XX9wsdBJ.zip) (1.8 KB)

---

<div class="post-metadata">

**Author:** ![Raja.G](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/raja.g/32/254554_2.png) [@Raja.G](https://forum.uipath.com/u/Raja.G)\
**Post date:** [July 29, 2020, 7:55am UTC](https://forum.uipath.com/t/how-to-append-string-to-array-variable/241456/20 "2020-07-29T07:55:18Z")

</div>

@supermanPunch,

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

Please help this

[Next page](https://forum.uipath.com/t/how-to-append-string-to-array-variable/241456.md?page=2)
