# Dynamic button group options based on selections in another button group

**URL:** <https://community.feathery.io/t/dynamic-button-group-options-based-on-selections-in-another-button-group/1290>\
**Category:** Support\
**Created:** [January 31, 2025, 2:42am UTC](https://community.feathery.io/t/dynamic-button-group-options-based-on-selections-in-another-button-group/1290 "2025-01-31T02:42:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Belalenok](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@Belalenok](https://community.feathery.io/u/Belalenok)\
**Post date:** [January 31, 2025, 2:42am UTC](https://community.feathery.io/t/dynamic-button-group-options-based-on-selections-in-another-button-group/1290/1 "2025-01-31T02:42:32Z")

</div>

Hi!  
I have Question1 which is a button group with several options (A, B, C).  
There is Question2 which is also a button group with same options (A, B, C).

I need to do the following:  
If user selects option A in Question1, then Question2 should show only one option - A.

I tried to come up with advanced logic for this, but for some reason it doesn’t work - it still shows all options for Question2.

```auto
if (feathery.fields['Question1'].value === 'A')
feathery.fields['Question2'].options = ['1'];

```

Will appreciate any advice!

---

<div class="post-metadata">

**Author:** ![Kenny](https://avatars.discourse-cdn.com/v4/letter/k/90db22/32.png) [@Kenny](https://community.feathery.io/u/Kenny)\
**Post date:** [February 4, 2025, 2:36pm UTC](https://community.feathery.io/t/dynamic-button-group-options-based-on-selections-in-another-button-group/1290/2 "2025-02-04T14:36:42Z")

</div>

**Hi @Belalenok,**

You can set the button group options like this:

- `ButtonGroup1.value[0]` holds the selected button in the group.
- `ButtonGroup1.options[0].value` holds the option values (you can replace `0` with the index of the option you want).

If the selected button matches a specific option, you can update `ButtonGroup2` like this:

```auto
if (ButtonGroup1.value[0] === ButtonGroup1.options[0].value) { 
  ButtonGroup2.options = [ButtonGroup2.options[0]];
}

In this example, the ButtonGroup2 will only display its first option if the condition are met

```

Let me know if this works!
