# Dropdown on change value not setting a variable in the workflow

**URL:** <https://community.weweb.io/t/dropdown-on-change-value-not-setting-a-variable-in-the-workflow/15537>\
**Category:** Ask us anything\
**Created:** [January 24, 2025, 8:16am UTC](https://community.weweb.io/t/dropdown-on-change-value-not-setting-a-variable-in-the-workflow/15537 "2025-01-24T08:16:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mick](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@Mick](https://community.weweb.io/u/Mick)\
**Post date:** [January 24, 2025, 8:16am UTC](https://community.weweb.io/t/dropdown-on-change-value-not-setting-a-variable-in-the-workflow/15537/1 "2025-01-24T08:16:38Z")

</div>

Hi,  
I have my dropdown bound to a data object. I have another variable (Game Form) which is a json object in which i would like to capture my dropdown selection. Its not setting the variable for some reason in the workflow on the on change event.

The dropdown is bound to a data object called Game Data.

Game Form Variable looks like this

{  
“opponentId”: 0 (initial value)  
}

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

thanks

---

<div class="post-metadata">

**Author:** ![Mick](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@Mick](https://community.weweb.io/u/Mick)\
**Post date:** [January 24, 2025, 10:24am UTC](https://community.weweb.io/t/dropdown-on-change-value-not-setting-a-variable-in-the-workflow/15537/2 "2025-01-24T10:24:39Z")

</div>

setKeyValue(variables[‘…’], ‘opponentId’,variables[‘…1-value’])

Ok the solution is to Use the co-pilot feature to generate an answer 🙂
