I have a Boolean column that I need to link to what is displayed in an alternate column… or more to the point, prevent from being set to ’true’ (checked) if the alternate column is displaying ‘false’ (unchecked).
I have utilised an IF - Then - Else but it is not functioning correctly.
So my question is: Can a Lookup Column be used as the IF… and if so, what should it be set to as:
is not checked
is false
Do not seem to be working (IE in order to prevent the THEN boolean column being set to true (checked) when the IF Lookup column is displaying false (not checked).
Here is the logic:
IF → Look Up Column is: Not Checked (or false)
THEN → false
ELSE → Boolean Column
What you have described seems to make sense, but can you expand more on what you mean by “it is not functioning correctly”? What is the IF column doing that you are not expecting? Can you show how the column is set up and antbrelavant columns like the lookup column and relation that the lookup might be using?
A boolean column can be in one of the states: true, false, or blank. Because it can also be blank, it is always a good idea to compare using checked or unchecked instead of true or false.
I was hoping to have the boolean column ‘lock’ if the Look Up column is not checked (ie false or empty).
*I have now worked out that the IF THEN ELSE works as it should (displays the correct info from the companies data table BUT it does not prevent the target boolean from being modified… which makes sense)
As a bit more of a backgrounder, in my app a user is connected to a company.
Users are in User Data Table and Companies are in Companies Data Table
IF a company has a specific detail selected (via boolean = true)… IE something like, registered for activity, then I want to be able to prevent a boolean column in the User Table linked to the users row from being able to be checked/selected if the company boolean is false.
IE The user’s company must be ‘registered for activity’ in order for a user to be registered for activity.
If the company is NOT registered for activity (boolean = false) I need the users boolean for ‘registered for activity’ to be locked out (false). → What I am after is for the only way that you can switch the user ‘registered for activity’ boolean column to true, is if the Company registered for activity column in the Companies Data Table is, boolean = true.
How are you presenting the boolean on the UI?
Assuming a switch or checkbox, why not just use visibility to hide it?
2 Likes