# Databind switches

**URL:** <https://forums.fusetools.com/t/databind-switches/3923>\
**Category:** How-to Discussions\
**Created:** [April 6, 2016, 8:08pm UTC](https://forums.fusetools.com/t/databind-switches/3923 "2016-04-06T20:08:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jozef](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@Jozef](https://forums.fusetools.com/u/Jozef)\
**Post date:** [April 6, 2016, 8:08pm UTC](https://forums.fusetools.com/t/databind-switches/3923/1 "2016-04-06T20:08:57Z")

</div>

Hi,

I am trying to figure out how to bind multiple switches to one switch.

Im pulling a list of names that can be selected with a switch from a JSON file. I also added a extra item to the list which is suppose to be a “select all” switch.

Is this posible and if so how do i do this?

here’s my code and a visual representation of what im trying to do.

```auto
<StackPanel Margin="10,0,10,0" Height="50%">
            <Panel>
                <Text Value="Select all" Alignment="CenterLeft" Margin="10,0,0,0" />
                <Switch Alignment="CenterRight"/>
            </Panel>
            <FineLine />
            <Each Items="{data.persons}">
                <Panel>
                    <Text Width="200" Value="{name}" Alignment="CenterLeft" TextWrapping="NoWrap" Margin="10,0,0,0" />
                    <Switch Alignment="CenterRight" Value="{isSelected}"/>
                </Panel>
            <FineLine />
            </Each>
        </StackPanel>

```

![file](https://s3.us-east-2.amazonaws.com/fuse-legacy-forum-assets/C0y5zWg6wJnc-legacy-files-ca3xIdfj9TzBhzDE-YbjiizjsIlcyRyCNWPOGP_xs.png)

---

<div class="post-metadata">

**Author:** ![Jozef](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@Jozef](https://forums.fusetools.com/u/Jozef)\
**Post date:** [April 8, 2016, 3:14pm UTC](https://forums.fusetools.com/t/databind-switches/3923/2 "2016-04-08T15:14:37Z")

</div>

For those that are trying the same thing. I solved it using [this](https://www.fusetools.com/community/forums/feature_requests/add_source_property_to_switch?page=1&highlight=85f669d2-1ccd-436e-a905-db5f36c1cd97#post-85f669d2-1ccd-436e-a905-db5f36c1cd97) code

My code now looks like this:

```auto
<Each Items="{data.persons}">
    <Panel>
        <Text Width="200" Value="{name}" Alignment="CenterLeft" TextWrapping="NoWrap" Margin="10,0,0,0" />
        <DependSwitch Master="{groupOne}" Alignment="CenterRight" Value="{selected}" />
        </Panel>
<FineLine />

```

And I added this line to my MainView.js exports.

```auto
groupOne: groupOne = Observable(false)

```
