# Toggle Button with Table: Does it need a separate column to save the state in?

**URL:** <https://connect.superhuman.com/t/toggle-button-with-table-does-it-need-a-separate-column-to-save-the-state-in/14940>\
**Category:** Ask the Community\
**Created:** [April 6, 2020, 12:46pm UTC](https://connect.superhuman.com/t/toggle-button-with-table-does-it-need-a-separate-column-to-save-the-state-in/14940 "2020-04-06T12:46:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Senthil\_Seveelavananan](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/senthil_seveelavananan/32/10243_2.png) [@Senthil\_Seveelavananan](https://connect.superhuman.com/u/Senthil_Seveelavananan)\
**Post date:** [April 6, 2020, 12:46pm UTC](https://connect.superhuman.com/t/toggle-button-with-table-does-it-need-a-separate-column-to-save-the-state-in/14940/1 "2020-04-06T12:46:22Z")

</div>

Is there a way to do a toggle button that doesn’t use extra columns? I want to make a simple meeting attendance table. Have a number of columns for each person (personA, personB, personC). Then a button for each person that toggle from ‘present’ to ‘absent’

Thanks

---

<div class="post-metadata">

**Author:** ![Luis\_Retana](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/luis_retana/32/14034_2.png) [@Luis\_Retana](https://connect.superhuman.com/u/Luis_Retana)\
**Post date:** [April 6, 2020, 3:25pm UTC](https://connect.superhuman.com/t/toggle-button-with-table-does-it-need-a-separate-column-to-save-the-state-in/14940/2 "2020-04-06T15:25:04Z")

</div>

I have a similar question, I have a table of participants of a training course where each training session attendance would be tracked in a separate column (Session 1, Session 2, etc) and a section where I would pick a session from a control and would see session specific info. I would like to create a button that would track present/absent on each participant based on the selected session.

---

<div class="post-metadata">

**Author:** ![Johg\_Ananda](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/johg_ananda/32/13930_2.png) [@Johg\_Ananda](https://connect.superhuman.com/u/Johg_Ananda)\
**Post date:** [April 6, 2020, 5:04pm UTC](https://connect.superhuman.com/t/toggle-button-with-table-does-it-need-a-separate-column-to-save-the-state-in/14940/3 "2020-04-06T17:04:51Z")

</div>

@Senthil_Seveelavananan & @Luis_Retana an example would help understand what you’re looking to do, but here’s something that has worked for me.

Create a user table `[_users]`, and have a column for each user’s attendance `[Attendance]`, true or false checkbox.

Then create a formula ‘`user`’ that maps to the logged in user:  
`_users.Filter(Email=User().Email).First()`

Then have a button which can toggle the attribute for the logged in user:

`ModifyRows( User, _users.[Attendance], User.[Attendance].Not() ) `

You can even get fancy and have the button’s label be dynamic:  
`If( User.[Attendance], "Attending", "Absent" )`

Good luck!

---

<div class="post-metadata">

**Author:** ![Luis\_Retana](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/luis_retana/32/14034_2.png) [@Luis\_Retana](https://connect.superhuman.com/u/Luis_Retana)\
**Post date:** [April 6, 2020, 7:15pm UTC](https://connect.superhuman.com/t/toggle-button-with-table-does-it-need-a-separate-column-to-save-the-state-in/14940/4 "2020-04-06T19:15:42Z")

</div>

Thanks @Johg_Ananda, this is an example of what I’m trying to do…I would like that when I select the control for the session, program the button to add present session’s column. I would also create the mark absent column in the same way.

https://coda.io/embed/Jyc9te7n31/_sudy2?viewMode=embedplay

---

<div class="post-metadata">

**Author:** ![Johg\_Ananda](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/johg_ananda/32/13930_2.png) [@Johg\_Ananda](https://connect.superhuman.com/u/Johg_Ananda)\
**Post date:** [April 6, 2020, 11:27pm UTC](https://connect.superhuman.com/t/toggle-button-with-table-does-it-need-a-separate-column-to-save-the-state-in/14940/5 "2020-04-06T23:27:33Z")

</div>

@Luis_Retana try using `switch()` for each ‘session’ case, switching between the column to update.

---

<div class="post-metadata">

**Author:** ![Luis\_Retana](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/luis_retana/32/14034_2.png) [@Luis\_Retana](https://connect.superhuman.com/u/Luis_Retana)\
**Post date:** [April 6, 2020, 11:41pm UTC](https://connect.superhuman.com/t/toggle-button-with-table-does-it-need-a-separate-column-to-save-the-state-in/14940/6 "2020-04-06T23:41:51Z")

</div>

Got it, thank you!!!
