If statement documentation (operators, functions, usage info)

Is there any more complete documentation on how to use “if” statements in Make? Things I want to know include:

  • Can we use “!=” for doesn’t equal? What other operators are available? = < > >= <=, etc.

  • Can we use parenthesis? Can we combine multiple things with AND or OR? What about NOT?

  • Can we use functions within an if statement? For example: if (count(something) > 1; this; that)

  • When do we use quotes? Can we use quotes? Should we use quotes? For example: if (myfield = “Yes”; this that)

Is there anywhere that fully documents using if statements in Make?

The official documentation on the if function can be found here https://www.make.com/en/help/functions/general-functions#if--expression--value1--value2-

If this is insufficient, please submit your feedback to Make support. You can open a new ticket, or if you are unable to login for some reason, you also can reach support using the contact form on the website.

For more information, you can also refer to Intermediate Functions in the Make Academy.

If you need further assistance, please provide the following:

  • specific question or example that you need assistance with

samliewrequest private consultation

2 Likes

Ok, I was eventually able to find some answers. It’s too bad the documentation isn’t more thorough. The thing that I haven’t really seen explained anywhere is that you can’t just type operators like AND, =, etc. You have to either click on the operators in the little side menu, or you have to enter them with two curly braces around them like {{=}}. Once I figured out that, a lot of the rest of it made more sense. So here are the answers to my questions to hopefully clear this up for other people also.

  • Can we use “!=” for doesn’t equal? What other operators are available? = < > >= <=, etc.

Yes, but they have to be entered as {{=}}, {{>}}, etc.

  • Can we use parenthesis? Can we combine multiple things with AND or OR? What about NOT?

Yes. As {{AND}}, etc.

  • Can we use functions within an if statement? For example: if (count(something) > 1; this; that)

Yes, that seems to work.

  • When do we use quotes? Can we use quotes? Should we use quotes? For example: if (myfield = “Yes”; this that)

No. Rather than using quotes around literals and strings, you instead use {{ }} around the language operators and keywords. It’s sort of the opposite of what you would usually do in most programming languages.

4 Likes

Hey there @sweatytofu :wave:

Great to hear that you solved this issue! Also thank you very much for sharing the solution and info with us!

Keep up the great job!

1 Like