Articles in this section

How to convert text to lower case using Lower()

This article explains what the Lower() function 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 on the PC.
  • Space owner access to the Templafy tenant.

What is the Lower() function?

Lower() is a function that converts text into lowercase. This function can also be used to make comparisons between two pieces of text that might not have a case match.

Lower() logic

Syntax  {{Lower(text)}}
Input Text
Output Lowercase version of the text

  Important

If you use the Small caps option from the Font properties in Microsoft Word to show text in lowercase, this might cause unexpected behavior when the binding is used for a dropdown form field (on 'Update document' it will show an empty content control).
So instead always use the Lower() function like {{Lower(Form.Office.Name)}}.

Lower() function examples

Example 1

Using the Lower() function to convert text to lowercase.

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

Example 2

Using the Lower() function together with IfElse() to convert the 'Warning' text if the 'ConvertToLowerCheckbox' checkbox question originating from the response form is checked.

Binding {{IfElse(Form.ConvertToLowerCheckbox, Lower(Form.Warning), Form.Warning)}}
Input Form.Warning= "THIS IS A WARNING" Form.Warning= "THIS IS A WARNING"
Condition

Form.ConvertToLowerCheckbox = "☑"

(True)

Form.ConvertToLowerCheckbox = ""

(False)

Output "this is a warning" "THIS IS A WARNING"

Example 3

Using the Lower() function together with IfElse() to convert the 'Subject' text if the 'DocumentType' dropdown question originating from the response form is using the option 'Not so important'.

Binding {{IfElse(Equals(Form.DocumentType.Name, "Not so important"), Lower(Form.Subject), Form.Subject)}}
Input Form.Subject= "Hello World" Form.Subject= "Hello World"
Condition

Form.DocumentType.Name = "Not so important"

(True)

Form.DocumentType.Name = "Important"

(False)

Output "hello world" "Hello World"

Example 4

Using the Lower() 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(Lower(Form.RecipientA), Lower(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

 

share value share smart fields tech_role
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.