# Change boolean state based on date column

**URL:** https://community.glideapps.com/t/change-boolean-state-based-on-date-column/38153
**Category:** Ask for Help
**Created:** [February 5, 2022, 12:32pm UTC](https://community.glideapps.com/t/change-boolean-state-based-on-date-column/38153 "2022-02-05T12:32:34Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![gannonatwork](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gannonatwork/32/91717_2.png) [@gannonatwork](https://community.glideapps.com/u/gannonatwork)
#### Post date: [February 5, 2022, 12:32pm UTC](https://community.glideapps.com/t/change-boolean-state-based-on-date-column/38153/1 "2022-02-05T12:32:34Z")

</div>

Hello. Curious if it is possible to change the value in two separate boolean columns based on the value of a date column in the same row? For example:

- Row XYZ has a date value of Saturday, February 5, 2022
- Column 123 should only be marked True if the date is on or after today
- Column 456 should only be marked True if the date is before today

I would appreciate any help on this. Thx!

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [February 5, 2022, 1:07pm UTC](https://community.glideapps.com/t/change-boolean-state-based-on-date-column/38153/2 "2022-02-05T13:07:07Z")

</div>

You can’t change the state of an existing boolean column based on the values in other columns (without a user-triggered action).

But what you can do is create an [if-then-else](https://docs.glideapps.com/all/topics/computed-columns/primary/if-then-else) column that will output a boolean value.

So you could do something like:

- If XYZ is on or after today then `true` (Column 123)
- If XYZ is before today then `true` (Column 456)

Depending on what you’re doing, it might make sense to combine those into a single column.

---

<div class="post-metadata">

### Author: ![gannonatwork](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gannonatwork/32/91717_2.png) [@gannonatwork](https://community.glideapps.com/u/gannonatwork)
#### Post date: [February 5, 2022, 4:19pm UTC](https://community.glideapps.com/t/change-boolean-state-based-on-date-column/38153/3 "2022-02-05T16:19:11Z")

</div>

Hi, @Darren_Murphy. I appreciate the input. I’m already using ITE to allow admins to view specific records using the In-App Filter based on the boolean value of the two columns I referenced earlier (plus others).

I guess what I really need is an ITE + AND/OR expression option inside of Glide tables (column type) like is available in the builder’s In-App Filter:

 ![Screen Shot 2022-02-05 at 8.59.18 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/5/45aa086dbafa3c2ddd0d904cd6a33d7362dee05d.png)

This way I wouldn’t need to create a user-triggered action like you mentioned. I could simply add an AND expression to the first “Approve” case in the example below and only display a value of “Approved” if the the Approve column was true AND the date is on or after today’s date, otherwise display “Archived”:

 ![Screen Shot 2022-02-05 at 9.28.33 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/a/4a062d06f3189be63f6a2f4b3313fa0771863ff2.png)

Is this just a limitation of ITE columns at this time, or am I missing another workaround/option for this use case? Thx

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [February 5, 2022, 4:30pm UTC](https://community.glideapps.com/t/change-boolean-state-based-on-date-column/38153/4 "2022-02-05T16:30:02Z")

</div>

> [@gannonatwork](#):
>
> Is this just a limitation of ITE columns at this time, or am I missing another workaround/option for this use case?

Perhaps, although it might be possible to get what you want. It’s just a little difficult to tell from the information you’ve given.

If you could express what you’re wanting to achieve (ignoring any Glide limitations) in pseudo-logic, what would that look like?

ie. something like:

- If foo is X AND bar is Y
- Then something
- Else if blah is Z OR cows is C
- Then something else

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [February 5, 2022, 5:30pm UTC](https://community.glideapps.com/t/change-boolean-state-based-on-date-column/38153/5 "2022-02-05T17:30:35Z")

</div>

What @Darren_Murphy is asking for would help a lot to give you a definitive answer, but purely guessing what you might need, I would do something like this to handle AND/OR logic in an IF column:

IF Pending is true THEN Pending  
ELSE IF Hide is true THEN Hidden  
ELSE IF Date is before Today THEN Archive  
ELSE IF Approved is true the Approved  
Else Archive

It’s all about reversing your logic and thinking to check for any condition that would be false instead of checking for something that would make it true. If nothing makes it false, then you return the true value. If columns always stop once they find a condition that results in a true condition.

---

<div class="post-metadata">

### Author: ![gannonatwork](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gannonatwork/32/91717_2.png) [@gannonatwork](https://community.glideapps.com/u/gannonatwork)
#### Post date: [February 5, 2022, 6:04pm UTC](https://community.glideapps.com/t/change-boolean-state-based-on-date-column/38153/6 "2022-02-05T18:04:48Z")

</div>

Awesome, these two additional statements did the trick! @Jeff_Hager, I appreciate you taking time to look this over and provide guidance on a workaround.

You, @Darren_Murphy, and several others are always so generous with your time and expertise; it doesn’t go unnoticed. Thanks again you guys. 👍

---

<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: [February 6, 2022, 6:05pm UTC](https://community.glideapps.com/t/change-boolean-state-based-on-date-column/38153/7 "2022-02-06T18:05:12Z")

</div>

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