# Express Yourself: Logical Functions in Microsoft Flow

In this post, I will discuss all the Logical functions that can be used in Microsoft Flow.

Function
Description
if
This function returns a specified value based on whether the expression resulted in true or false. This function requires three parameters: the expression to check; the value to return if the expression is true; and the value to return if the expression is false.
Function: if(expression, valueIfTrue, valueIfFalse)
Example: if(equals(10, 10), ‘Yes’, ‘No’)
Output: Yes
equals
This function checks if two values, expressions, or objects are equal. If they are, the function returns true, and if they are not, it returns false. This function requires two parameters: the values, expressions, or objects to compare. The output is Boolean (true or false).
Function: equals(object1, object2)
Example: equals(10, 10)
Output: true
and
This function checks if all the expressions are true. If they are, the function returns true, and if they are not, it returns false. This function requires two parameters: the expressions to check. The output is Boolean (true or false).
Function: and(expression1, expression2)
Function: and(equals(10, 10), equals(20, 20))
Output: true
or
This function checks if at least one expression is true. It returns true if one expression is true, and false if all the expressions are false. This function requires two parameters: the expressions to check. The output is Boolean (true or false).
Function: or(expression1, expression2)
Function: or(equals(10, 10), equals(20, 30))
Output: true
not
This function checks if an expression is false. It returns true if the expression is false, and false if the expression is true. This function requires one parameter: the expression to check. The output is Boolean (true or false).
Function: not(expression)
Example: not(equals(10, 20))
Output: true
less
This function checks if the first value is less than the second value. It returns true if the first value is less, and false if the first value is more. This function requires two parameters: the first value to check if less than the second value, and the item to compare. Both parameters can be the following types: Integer, Float, or String. The output is Boolean (true or false).
Function: less(value, compareTo)
Example: less(10, 20)
Output: true
lessOrEquals
This function checks if the first value is less than or equal to the second value. It returns true if the first value is less than or equal, and false if the first value is more. This function requires two parameters: the first value to check if less than or equal to the second value, and the item to compare. Both parameters can be the following types: Integer, Float, or String. The output is Boolean (true or false).
Function: lessOrEquals(value, compareTo)
Example: lessOrEquals(10, 10)
Output: true
greater
This function checks if the first value is greater than the second value. It returns true if the first value is more, and false if the first value is less. This function requires two parameters: the first value to check if more than the second value, and the item to compare. Both parameters can be the following types: Integer, Float, or String. The output is Boolean (true or false).
Function: greater(value, compareTo)
Example: greater(20, 10)
Output: true