# Dynamically change the dropdown content of one input based on the value of another input

**URL:** <https://forum.builder.io/t/dynamically-change-the-dropdown-content-of-one-input-based-on-the-value-of-another-input/4748>\
**Category:** Visual Editor Help\
**Tags:** react, api\
**Created:** [January 5, 2024, 6:21pm UTC](https://forum.builder.io/t/dynamically-change-the-dropdown-content-of-one-input-based-on-the-value-of-another-input/4748 "2024-01-05T18:21:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vicbuilder](https://avatars.discourse-cdn.com/v4/letter/v/65b543/32.png) [@vicbuilder](https://forum.builder.io/u/vicbuilder)\
**Post date:** [January 5, 2024, 6:21pm UTC](https://forum.builder.io/t/dynamically-change-the-dropdown-content-of-one-input-based-on-the-value-of-another-input/4748/1 "2024-01-05T18:21:30Z")

</div>

**Builder content link**

```auto

```

**Builder public api key**  
9b05a53a9463408aa0ffa696febd3688

**What are you trying to accomplish**  
build a custom component

**Screenshots or video link**  
n/a

**Code stack you are integrating Builder with**

- gatsby, react,

**Reproducible code example**

```auto
//Testing.builder.js

Builder.registerComponent(Testing, {
 name: 'Testing',
 inputs: [ 
   {
     name: 'LIST_INPUT',
     type: 'list',
     subFields: [
     ],     
     onChange: (options) => {
       if (options.get('LIST_INPUT').length > 2) {
        //
       }
       /*
         if more than 2 items in LIST_INPUT
           then change DROPDOWN_INPUT's dropdown content to ['A', 'B', 'C', 'D']
         if less than 3 items in LIST_INPUT
           then change DROPDOWN_INPUT's dropdown content to ['A', 'B']
       */
     }
   },
   {
     name: 'DROPDOWN_INPUT',
     type: 'string',
     enum: ['A', 'B']
   }, 
    
 ]
})

```

**Question:** I was wondering if it’s possible to achieve the following:  
Dynamically change the content of **DROPDOWN\_INPUT** based on the number of items the user adds to **LIST\_INPUT**.

Thank you so much for your help. 👀 🙏

---

<div class="post-metadata">

**Author:** ![JuliusGD](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/juliusgd/32/2523_2.png) [@JuliusGD](https://forum.builder.io/u/JuliusGD)\
**Post date:** [February 5, 2024, 8:55pm UTC](https://forum.builder.io/t/dynamically-change-the-dropdown-content-of-one-input-based-on-the-value-of-another-input/4748/2 "2024-02-05T20:55:42Z")

</div>

Hello vicbuilder,

I’ve come across your forum post and would be happy to provide some guidance.

Is the following use case something you had in mind?  
The dynamic dropdown may exist at a later point in a form and depending on what the user has chosen the list will display different options.

Please let me know if there’s anything I’ve misunderstood about the inquiry.
