Articles in this section

How to determine if two values are equal using Equals()

This article explains what the Equals() operator is and provide examples of how it 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 Equals() operator?

Equals() is an operator that returns True/False depending on if two values are equal or not. Equals() is case sensitive, comparisons between two values that might be using different casings can be achieved by using a Lower() or Upper() function together with Equals().

Equals() logic

Syntax {{Equals(Value1, Value2)}}
Output True/False

Equals() operator examples

Example 1

Using the Equals() operator to check if two values are equal.

Binding {{Equals("this is text", "this is text")}}
Output True
Binding {{Equals("this is text", "this is another text")}}
Output False

Example 2

Using the Equals() operator together with Lower() to match the casing used and make a comparison.

Binding {{Equals(Lower("this is text"), Lower("THIS IS TEXT"))}}
Output True

Example 3

Using the Equals() operator together with Not() and Lower() to match the casing used and make a comparison.

Binding {{Not(Equals(Lower("this is text"), Lower("THIS IS TEXT")))}}
Output False

Example 4

Using the Equals() operator together with IfElse() and Lower() to match the casing used in the "RecipientA" and the "RecipientB" questions originating from the response form and make a comparison. If the values are equal, the output should be "Send to the recipient listed above", otherwise the value for "RecipientB" should be shown. 

Binding {{IfElse(Equals(Lower(Form.RecipientA), Lower(Form.RecipientB)), "Send to the recipient listed above", Form.RecipientB)}}
Input Form.RecipientA = "John Smith"
Form.RecipientB = "john smith"
Form.RecipientA = "John Smith"
Form.RecipientB = "John Doe"
Condition True False
Output "Send to the recipient listed above" "John Doe"
repeating group reference tech_role
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.