# How to only set a path defined value, but using wwLib.wwVariable.updateValue()

**URL:** https://community.weweb.io/t/how-to-only-set-a-path-defined-value-but-using-wwlib-wwvariable-updatevalue/10301
**Category:** How do I?
**Created:** [August 18, 2024, 3:45am UTC](https://community.weweb.io/t/how-to-only-set-a-path-defined-value-but-using-wwlib-wwvariable-updatevalue/10301 "2024-08-18T03:45:54Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Micah](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/micah/32/9102_2.png) [@Micah](https://community.weweb.io/u/Micah)
#### Post date: [August 18, 2024, 3:45am UTC](https://community.weweb.io/t/how-to-only-set-a-path-defined-value-but-using-wwlib-wwvariable-updatevalue/10301/1 "2024-08-18T03:45:54Z")

</div>

If my goal is to only change the data via a specific path (say ‘colors’ in the variable that I define, how would I do that in this formula? wwLib.wwVariable.updateValue(varId, value)

What i’m looking for is essentially this, but I need the variable to be dynamic

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

---

<div class="post-metadata">

### Author: ![dorilama](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/dorilama/32/10403_2.png) [@dorilama](https://community.weweb.io/u/dorilama)
#### Post date: [August 18, 2024, 5:44am UTC](https://community.weweb.io/t/how-to-only-set-a-path-defined-value-but-using-wwlib-wwvariable-updatevalue/10301/2 "2024-08-18T05:44:55Z")

</div>

assuming your variable is an object and the dynamic property is top level: `updateValue(uid,{...variableValue,[dynamicProperty]:newValue})`

you can modify it to a deeper nested property. with a some more effort you can recreate a function to update an arbitrary level of nesting desined from a string path
