# Is there a way to iterate through every row in the table and change the value of boolean based on condition on click of button

**URL:** <https://community.glideapps.com/t/is-there-a-way-to-iterate-through-every-row-in-the-table-and-change-the-value-of-boolean-based-on-condition-on-click-of-button/74196>\
**Category:** Ask for Help\
**Created:** [June 18, 2024, 5:36am UTC](https://community.glideapps.com/t/is-there-a-way-to-iterate-through-every-row-in-the-table-and-change-the-value-of-boolean-based-on-condition-on-click-of-button/74196 "2024-06-18T05:36:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dilip\_Adiga](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dilip_adiga/32/60330_2.png) [@Dilip\_Adiga](https://community.glideapps.com/u/Dilip_Adiga)\
**Post date:** [June 18, 2024, 5:36am UTC](https://community.glideapps.com/t/is-there-a-way-to-iterate-through-every-row-in-the-table-and-change-the-value-of-boolean-based-on-condition-on-click-of-button/74196/1 "2024-06-18T05:36:42Z")

</div>

Hi Guys,

I have a table where there is a column “A” , “B”,“C” which are all boolean. This table has lets say 30 rows. Each will have true or False as value in column A

On click of a button. I want it to check a condition wether column A has any true or false value and then update column B with the same value as in A. but it should happen for each row.

I know set column value happens only for particular row. Is there any workaround?

Thank you in advance for help.

Regards,  
Dilip

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 19, 2024, 12:31am UTC](https://community.glideapps.com/t/is-there-a-way-to-iterate-through-every-row-in-the-table-and-change-the-value-of-boolean-based-on-condition-on-click-of-button/74196/2 "2024-06-19T00:31:47Z")

</div>

So you consider a boolean to have 3 states: true, false and empty, and want to copy from column A to column B?

If they’re all basic columns, you can use the API, fetch all rows from that table, and use a set column method to bring the value from A to B, though I’m not sure what’s the use case for that.

---

<div class="post-metadata">

**Author:** ![Dilip\_Adiga](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dilip_adiga/32/60330_2.png) [@Dilip\_Adiga](https://community.glideapps.com/u/Dilip_Adiga)\
**Post date:** [June 19, 2024, 1:32am UTC](https://community.glideapps.com/t/is-there-a-way-to-iterate-through-every-row-in-the-table-and-change-the-value-of-boolean-based-on-condition-on-click-of-button/74196/3 "2024-06-19T01:32:45Z")

</div>

> [@ThinhDinh](#):
>
> So you consider a boolean to have 3 states: true, false and empty, and want to copy from column A to column B?

Yes Correct 3 states.

Use case:

I have about 50 creators whom I Manage. Each creator has a boolean to know wether they are there with us, Meaning if they are with us the boolean is true. If not false.

This needs to be checked every time I click on button for one year that is 52 Weeks from start date

I will have Column A , Column B, Column C … let’s say till Column number 54

When on a particular day I click the button

It should check the Column A boolean value. And then check wether column B has values and if it does not have value it should set values in column B. If column B has values in it it should set values to column C.

> [@ThinhDinh](#):
>
> If they’re all basic columns, you can use the API, fetch all rows from that table, and use a set column method to bring the value from A to B, though I’m not sure what’s the use case for that.

My use case wont work for this I guess right?

Can we use API to Create a new row? where it fetches values from Table 1 and writes it into columns in Table 2 ? Would that be possible?

Or what do you suggest I do for my use case mentioned? Wouldn’t creating new row in a table with all of my creators and their values be a better approach? That way I can keep creating rows whenever I press that button.  
**Of course provided I can do that using API**

Thank you @ThinhDinh for your response. Quite stuck with this issue.

Regards,  
Dilip

---

<div class="post-metadata">

**Author:** ![Dilip\_Adiga](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dilip_adiga/32/60330_2.png) [@Dilip\_Adiga](https://community.glideapps.com/u/Dilip_Adiga)\
**Post date:** [June 19, 2024, 3:16am UTC](https://community.glideapps.com/t/is-there-a-way-to-iterate-through-every-row-in-the-table-and-change-the-value-of-boolean-based-on-condition-on-click-of-button/74196/4 "2024-06-19T03:16:05Z")

</div>

Also just so that we are aligned, By API you mean Glide API ? Or Zapier?

Regards,  
Dilip

---

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [June 19, 2024, 5:38am UTC](https://community.glideapps.com/t/is-there-a-way-to-iterate-through-every-row-in-the-table-and-change-the-value-of-boolean-based-on-condition-on-click-of-button/74196/5 "2024-06-19T05:38:31Z")

</div>

Please, learn this method and adapt it to your needs

[![](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/a/daee86fcd0e13c4034c789717186e37ef6ec21aa.jpeg "🎓 Glide Tutorial - Add, Edit or Delete Multiple Rows (Glide API)") ](https://www.youtube.com/watch?v=b7_k3_brusQ)

---

<div class="post-metadata">

**Author:** ![Dilip\_Adiga](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dilip_adiga/32/60330_2.png) [@Dilip\_Adiga](https://community.glideapps.com/u/Dilip_Adiga)\
**Post date:** [June 20, 2024, 11:16am UTC](https://community.glideapps.com/t/is-there-a-way-to-iterate-through-every-row-in-the-table-and-change-the-value-of-boolean-based-on-condition-on-click-of-button/74196/6 "2024-06-20T11:16:32Z")

</div>

Thank you for sharing this Himaldin 🙂  
Saved my day.

Regards,  
Dilip

---

<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:** [June 27, 2024, 11:16am UTC](https://community.glideapps.com/t/is-there-a-way-to-iterate-through-every-row-in-the-table-and-change-the-value-of-boolean-based-on-condition-on-click-of-button/74196/7 "2024-06-27T11:16:55Z")

</div>

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