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

Builder content link

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

//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. :eyes: :pray:

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.