This article explains what the GreaterThan(), LessThan() and Equals() functions are that you can use with number values and provide examples of how they can be used with the binding syntax in smart templates.
Prerequisites
- Library and at least one Dynamics module enabled.
- Templafy Desktop and Office VSTO add-in installed.
-
Space owner access to the Templafy tenant.
|
What is the GreaterThan() function?
The GreaterThan() function can be used in combination with the IfElse() function and returns output based on the condition if the number value entered is greater than the number used in the expression.
GreaterThan() logic
Example
Using the GreaterThan() function together with the IfElse() function. Depending on the value entered the output is 'Value is greater than 10' or 'Value is 10 or less':
Important
The GreaterThan() function only works with numeric fields, so the field 'Form.Number' in the example is of Type 'Number'.
|
What is the LessThan() function?
The LessThan() function can be used in combination with the IfElse() function and returns output based on the condition if the number value entered is less than the number used in the expression.
LessThan() logic
Example 1
Using the LessThan() function together with the IfElse() function. Depending on the value entered the output is 'Value is less than 10' or 'Value is 10 or greater':
Important
The LessThan() function only works with numeric fields, so the field 'Form.Number' in the example is of Type 'Number'.
|
Example 2
Using the LessThan() and GreaterThan() function together with the IfElse() and And() function. Depending on the value entered the visibility (e.g. of text/image) is set to visible or hidden:
What is the Equals() function?
The Equals() function can be used in combination with the IfElse() function and returns output based on the condition if the number value entered is equal to the number used in the expression.
Equals() logic
Example
Using the Equals() function together with the IfElse() function. Depending on the value entered the output is 'Perfect score' or 'Please try again':
Important
- The Equals() function works with both numeric fields and text fields. In the example above the field 'Form.Number' is of
Type 'Number', but you can also use the Equals() function with a field of Type 'Text'. In that case you need to put quotes around the value like this:
{{IfElse(Equals(Form.Number, "10"), "Perfect
score", "Please try again")}}
- If the Equals() function is used with numbers, it's recommended to use fields of
Type 'Number' instead of 'Text'.
|
Comments
Article is closed for comments.