About this article
This article explains what the Proper() function is and provide examples of how it can be used with the binding syntax in smart templates.
Prerequisites
|
What is the Proper() function?
Proper() is a function that converts a piece of text to proper case, meaning that the first letter of every word is capitalized.
Proper() logic
Syntax | {{Proper(text)}} |
Input | Text |
Output | Proper case version of the text |
Proper() function examples
Example 1
Using the Proper() function to convert text to proper case.
Binding | {{Proper("this is text")}} |
Output | "This Is Text" |
Example 2
Using the Proper() function together with IfElse() to convert the "Title" text if the "ConvertToProperCheckbox" checkbox question originating from the response form is checked.
Binding | {{IfElse(Form.ConvertToProperCheckbox, Proper(Form.Title), Form.Title)}} | |
Input | Form.Title= "this is a title" | Form.Title= "this is a title" |
Condition |
Form.ConvertToProperCheckbox = "☑" (True) |
Form.ConvertToProperCheckbox = "☐" (False) |
Output | "This Is A Title" | "this is a title" |
Example 3
Using the Proper() function together with IfElse() to convert the "Title" text if the "HeadlineType" dropdown question originating from the response form is utilizing the option "Title".
Binding | {{IfElse(Equals(Form.HeadlineType.Name, "Title"), Proper(Form.Title), Form.Title)}} | |
Input | Form.Title= "this is a title" | Form.Title= "this is a title" |
Condition |
Form.HeadlineType.Name = "Title" (True) |
Form.HeadlineType.Name = "Not a title" (False) |
Output | "This Is A Title" | "this is a title" |
Related articles
Comments
Article is closed for comments.