# Set value in array index

**URL:** <https://forum.uipath.com/t/set-value-in-array-index/26322>\
**Category:** Help\
**Tags:** studio\
**Created:** [March 21, 2018, 6:23am UTC](https://forum.uipath.com/t/set-value-in-array-index/26322 "2018-03-21T06:23:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sams](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sams/32/56005_2.png) [@sams](https://forum.uipath.com/u/sams)\
**Post date:** [March 21, 2018, 6:23am UTC](https://forum.uipath.com/t/set-value-in-array-index/26322/1 "2018-03-21T06:23:54Z")

</div>

HI,

I want to set value(string) in array index. How can I add in array index value?

Like: I have secondSplit array, and I want to add value on seconSplit[0]=“string”.

I had tried like this,

 ![image](https://global.discourse-cdn.com/uipath/original/2X/9/911dcbe4db9e4010b149546731edb7ad024dc986.png)

Is there any solution for this?

thanks.

---

<div class="post-metadata">

**Author:** ![arivu96](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@arivu96](https://forum.uipath.com/u/arivu96)\
**Post date:** [March 21, 2018, 6:27am UTC](https://forum.uipath.com/t/set-value-in-array-index/26322/2 "2018-03-21T06:27:09Z")

</div>

Hi @sams,

Refer this

> **[Array Variables](https://docs.uipath.com/studio/docs/array-variables)**
>
> The array variable is a type of variable which enables you to store multiple values of the same type. UiPath Studio supports as many types of arrays as it does types of variables. This means that you can create an array of numbers, one of strings,...

if you are already declared the array length  
you can directly use assign activity to update the value  
`arr(3)="yourvalue"`

Regards,  
Arivu

---

<div class="post-metadata">

**Author:** ![sams](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sams/32/56005_2.png) [@sams](https://forum.uipath.com/u/sams)\
**Post date:** [March 23, 2018, 7:03am UTC](https://forum.uipath.com/t/set-value-in-array-index/26322/5 "2018-03-23T07:03:14Z")

</div>

![image](https://global.discourse-cdn.com/uipath/original/2X/8/8b1558a66c8e23f0d9f8d6f3a2dd742831afbbc6.png)

any solution for this?

---

<div class="post-metadata">

**Author:** ![arivu96](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@arivu96](https://forum.uipath.com/u/arivu96)\
**Post date:** [March 23, 2018, 7:15am UTC](https://forum.uipath.com/t/set-value-in-array-index/26322/6 "2018-03-23T07:15:40Z")

</div>

Hi @sams,

The error clearly saying the value is null  
not created the object of the variable.

can you send the screenshot of the Assign activity and variables

Regards,  
Arivu

---

<div class="post-metadata">

**Author:** ![sams](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sams/32/56005_2.png) [@sams](https://forum.uipath.com/u/sams)\
**Post date:** [March 23, 2018, 7:27am UTC](https://forum.uipath.com/t/set-value-in-array-index/26322/7 "2018-03-23T07:27:54Z")

</div>

Hi @arivu96,

 ![image](https://global.discourse-cdn.com/uipath/original/2X/c/c49ad7721942f0208eabb27c542d22674f7a0d3c.png)

---

<div class="post-metadata">

**Author:** ![andrzej.kniola](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/andrzej.kniola/32/8835_2.png) [@andrzej.kniola](https://forum.uipath.com/u/andrzej.kniola)\
**Post date:** [March 23, 2018, 7:32am UTC](https://forum.uipath.com/t/set-value-in-array-index/26322/8 "2018-03-23T07:32:57Z")

</div>

Just a sidenote, but please reconsider the amount of nested activities you have in 1 workflow - that screenshot is frightening a little bit.  
I’d highly recommend getting familiar with invokes (f.e. via Academy Level 3) and splitting it up to subflows, as I can with a fair bit of certainty say that you will have problems with execution logic in this.
