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!
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 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.
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:
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”:
Is this just a limitation of ITE columns at this time, or am I missing another workaround/option for this use case? Thx
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
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
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.
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.
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.