About this article
This article explains what the Upper() function is and provide examples of how it can be used with the binding syntax in smart templates.
Prerequisites
|
What is the Upper() function?
Upper() is a function that converts text into uppercase. This function can also be used to make comparisons between two pieces of text that might not have a case match.
Upper() logic
Syntax | {{Upper(text)}} |
Input | Text |
Output | Uppercase version of the text |
|
Upper() function examples
Example 1
Using the Upper() function to convert text to uppercase.
Binding | {{Upper("this is text")}} |
Output | "THIS IS TEXT" |
Example 2
Using the Upper() function together with IfElse() to convert the "Warning" text if the "ConvertToUpperChecbox" checkbox question originating from the response form is checked.
Binding | {{IfElse(Form.ConvertToUpperCheckbox, Upper(Form.Warning), Form.Warning)}} | |
Input | Form.Warning= "this is a warning" | Form.Warning= "this is a warning" |
Condition |
Form.ConvertToUpperCheckbox = "☑" (True) |
Form.ConvertToUpperCheckbox = "☐" (False) |
Output | "THIS IS A WARNING" | "this is a warning" |
Example 3
Using the Upper() function together with IfElse() to convert the "Warning" text if the "DocumentType" dropdown question originating from the response form is utilizing the option "Important".
Binding | {{IfElse(Equals(Form.DocumentType.Name, "Important"), Upper(Form.Warning), Form.Warning)}} | |
Input | Form.Warning= "this is a warning" | Form.Warning= "this is a warning" |
Condition |
Form.DocumentType.Name = "Important" (True) |
Form.DocumentType.Name = "Not so important" (False) |
Output | "THIS IS A WARNING" | "this is a warning" |
Example 4
Using the Upper() function together with IfElse() and Equals() to compare the values of "Recipient A" and "Recipient B" questions originating from the response form and verify if they are similar but just using different casing. If they are similar display "Recipient A and B are the same and both packages should be consolidated and sent as one" otherwise show the value of the "RecipientB" question.
Binding | {{IfElse(Equals(Upper(Form.RecipientA), Upper(Form.RecipientB)), "Recipient A and B are the same and both packages should be consolidated and sent as one", Form.RecipientB)}} | |
Input |
Form.RecipientA = "John Smith" Form.RecipientB = "john smith" |
Form.RecipientA = "John Smith" Form.RecipientB = "john doe" |
Condition | True | False |
Output | "Recipient A and B are the same and both packages should be consolidated and sent as one" | john doe |
Related articles
Comments
0 comments
Article is closed for comments.