🤖 How to reverse the value of a boolean from "true" to "false" in Make?



:question: :question: :question:

What would be the most effective method to reverse the value of a boolean from “true” to “false” if it currently returns “true”?


:reply: :reply::reply:


TLDR: You would want to use the if function for that.

If function to copy: {{if(VALUE = true; false; true)}}


Hypothetical situation:

You’re hosting a casual meeting and plan to serve dessert. To accommodate nut allergies, you ask guests to fill out a form indicating their nut consumption preferences. This allows you to prepare either a hazelnut or fruit version of the dessert accordingly. :cake: :ice_cream:

Once the form is completed, all the info is automatically sent to a Google Sheet.

  • If a guest answers “yes” to “Do you eat nuts?”, the “Nut allergy?” column should be marked as “FALSE.”
  • Conversely, if they answer “no,” the column should be marked as “TRUE.”


As we can see in the sheet:

  • Diego said he does eat nuts and therefore we know he is not allergic :chestnut:
  • Jenna said she does not eat nuts so we know she might be allergic and will have a fruit ice cream ready for her. :strawberry:


What helps to reverse the ‘true’ boolean to its ‘false’ value is the if function.

If function to copy: {{if(VALUE = true; false; true)}}




Helpful resources:

:make: If function
:make: 🎓 [Getting Started with Functions p. 1] General Functions
:make: 🤖 What are the most useful functions in Make and some examples of using them?