# Increment boolean should cycle between 1 and 0

**URL:** <https://community.glideapps.com/t/increment-boolean-should-cycle-between-1-and-0/36244>\
**Category:** Ask for Help\
**Created:** [December 22, 2021, 7:32pm UTC](https://community.glideapps.com/t/increment-boolean-should-cycle-between-1-and-0/36244 "2021-12-22T19:32:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Gabler](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david_gabler/32/44332_2.png) [@David\_Gabler](https://community.glideapps.com/u/David_Gabler)\
**Post date:** [December 22, 2021, 7:32pm UTC](https://community.glideapps.com/t/increment-boolean-should-cycle-between-1-and-0/36244/1 "2021-12-22T19:32:57Z")

</div>

I have a field set to boolean, and when I click an item in a list, I want it to cycle between on and off. I select the action “add one to this number”, because a bit, if you shift it, cycles between 1 and 0. But not in Glide. I cannot simply set action to “set column values” and set it to true, because there is no “if, then, else” in set column values.

---

<div class="post-metadata">

**Author:** ![SantiagoPerez](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/santiagoperez/32/16807_2.png) [@SantiagoPerez](https://community.glideapps.com/u/SantiagoPerez)\
**Post date:** [December 22, 2021, 7:44pm UTC](https://community.glideapps.com/t/increment-boolean-should-cycle-between-1-and-0/36244/2 "2021-12-22T19:44:56Z")

</div>

Hola @David_Gabler

Inside the action builder you can have a condition:

If a is true \> set column value \> false

else \> set column value \> true

 ![Screen Shot 2021-12-22 at 1.44.07 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/0/e0f4ad4345b3da7ca45f6cac06475f7735151f17.png)

 ![Screen Shot 2021-12-22 at 1.44.15 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/5/45e172a55c6a6f921838a1fb209d7833b096b224.png)

---

<div class="post-metadata">

**Author:** ![David\_Gabler](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david_gabler/32/44332_2.png) [@David\_Gabler](https://community.glideapps.com/u/David_Gabler)\
**Post date:** [December 22, 2021, 8:08pm UTC](https://community.glideapps.com/t/increment-boolean-should-cycle-between-1-and-0/36244/3 "2021-12-22T20:08:01Z")

</div>

Thank you. Everything about Glide is more complex than a programming language, where you have granular control of every field and every variable at will. I never could get a handle on the Lego Mindstorms visual object programming language. There was no “flow” to it.

---

<div class="post-metadata">

**Author:** ![david](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david/32/62831_2.png) [@david](https://community.glideapps.com/u/david)\
**Post date:** [December 22, 2021, 8:10pm UTC](https://community.glideapps.com/t/increment-boolean-should-cycle-between-1-and-0/36244/4 "2021-12-22T20:10:26Z")

</div>

Interesting idea!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [December 23, 2021, 8:11pm UTC](https://community.glideapps.com/t/increment-boolean-should-cycle-between-1-and-0/36244/5 "2021-12-23T20:11:16Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
