# What to put in "path" to update a single item in an array within a variable?

**URL:** <https://community.weweb.io/t/what-to-put-in-path-to-update-a-single-item-in-an-array-within-a-variable/2900>\
**Category:** How do I?\
**Created:** [June 1, 2023, 12:07am UTC](https://community.weweb.io/t/what-to-put-in-path-to-update-a-single-item-in-an-array-within-a-variable/2900 "2023-06-01T00:07:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![raelyn](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/raelyn/32/2803_2.png) [@raelyn](https://community.weweb.io/u/raelyn)\
**Post date:** [June 1, 2023, 12:07am UTC](https://community.weweb.io/t/what-to-put-in-path-to-update-a-single-item-in-an-array-within-a-variable/2900/1 "2023-06-01T00:07:20Z")

</div>

I have an object variable (let’s call it variable X), and It has multiple fields, a, b, c, d.

Field D, the field I want to change, is an array of 3 things.

![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/b/b83e8c11b5c251ae3ee89aea6428d649bb35be13.png)

How do I update what’s in example, #0 of field D via a workflow, but NOT #1 and #2? i.e. instead of “I’m very excited to share…”, I want to change it to something else.

I tried to do this but it didn’t work.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/0/06e9f08336c33c89b9add76ba24c24281a1d2ba2.png)

It ended up like that:

![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/f/f651fa5ced9dbf60f7b02aa74135571e6838f3d7.png)

Or is there something else I have to do altogether rather than trying to change the variable value in workflow?

---

<div class="post-metadata">

**Author:** ![Dorian](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/dorian/32/13183_2.png) [@Dorian](https://community.weweb.io/u/Dorian)\
**Post date:** [June 1, 2023, 3:23am UTC](https://community.weweb.io/t/what-to-put-in-path-to-update-a-single-item-in-an-array-within-a-variable/2900/2 "2023-06-01T03:23:05Z")

</div>

I had a similar question about updating a single object in an array recently. I solved it using Co-Pilot but I’d like to know the no-code answer.

> [@Updating array variable with value entered by user](https://community.weweb.io/t/updating-array-variable-with-value-entered-by-user/2882):
>
> I have a datagrid that is bound to an array variable. I want the user to be able to edit a field and when they do, I want the array variable to be updated. I have an ‘on change’ workflow attached to the input field, configured as shown below. I have it configured to “Update one item” in the array using the index of the current item in the datagrid. I think that piece is right? But I can’t figure out what to put in the Value field. I tried asking the Co-Pilot to generate some custom js to updat…

---

<div class="post-metadata">

**Author:** ![aurelie](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/aurelie/32/13249_2.png) [@aurelie](https://community.weweb.io/u/aurelie)\
**Post date:** [June 1, 2023, 2:52pm UTC](https://community.weweb.io/t/what-to-put-in-path-to-update-a-single-item-in-an-array-within-a-variable/2900/3 "2023-06-01T14:52:33Z")

</div>

You seem to have the correct path, can you check the value you are using for the second parameter? It may explain the extra 0
