Text Formatting Function in Canvas App

Text formatting functions in a Canvas app are used to modify the appearance and layout of text in controls such as labels, text inputs, and text boxes. These functions can be used to adjust font size, style, color, alignment, and more.

Here are some commonly used text formatting functions in Canvas apps:

Text: This function is used to concatenate or combine text strings, and can also be used to convert numbers and dates to text format. The syntax is:

Text(Value, Format)

Where ‘Value’ is the value you want to convert to text, and Format is an optional argument that specifies the format of the text output.

For example, Text(1234, “$#,###.00”) would convert the number 1234 to a text string with a currency format of $1,234.00.


Concat: This function is used to concatenate or combine multiple text strings into a single string. The syntax is:

Concat(Text1, Text2, …, TextN)

Where ’Text1’, ‘Text2’, and ‘TextN’ are the text strings you want to combine.

For example, Concat(“Hello”, ” “, “World”) would combine the text strings “Hello”, ” “, and “World” into a single string “Hello World”.


Len: This function is used to calculate the length of a text string. The syntax is:

Len(Text)

Where ‘Text’ is the text string you want to calculate the length of.

For example, Len(“Hello World”) would return the value 11, which is the length of the text string “Hello World”.


Left, Right, Mid: These functions are used to extract a portion of a text string based on its position or length. The syntax for each function is:

Left(Text, NumChars)

Right(Text, NumChars)

Mid(Text, Start, NumChars)

Where ‘Text’ is the text string you want to extract from, ‘NumChars’ is the number of characters you want to extract and Start is the starting position of the characters you want to extract.

For example, Left(“Hello World”, 5) would extract the first 5 characters of the text string “Hello World”, which is “Hello”.


Replace: This function is used to replace a specific portion of a text string with another text string. The syntax is:

Replace(Text, Find, ReplaceWith)

Where ‘Text’ is the text string you want to replace from, Find is the text string you want to replace, and ReplaceWith is the text string you want to replace with.

For example, Replace(“Hello World”, “World”, “Universe”) would replace the text string “World” with “Universe” in the text string “Hello World”, resulting in the new string “Hello Universe”.


Lower: This function in Canvas apps is used to convert a text string to all lowercase letters. The syntax for the Lower function is:

Lower(Text)

Where ‘Text’ is the text string you want to convert to lowercase.

For example, Lower(“HELLO WORLD”) would return the text string “hello world”.


Upper: This function in Canvas apps is used to convert a text string to all uppercase letters. The syntax for the Upper function is:

Upper(Text)

Where ‘Text’ is the text string you want to convert to uppercase.

For example, Upper(“hello world”) would return the text string “HELLO WORLD”.


Proper: This function in Canvas apps is used to convert the first letter of each word in a text string to uppercase, while converting all other letters to lowercase. The syntax for the Proper function is:

Proper(Text)

Where ‘Text’ is the text string you want to convert to Proper case.

For example, Proper(“hELLO wORLD”) would return the text string “Hello World”.


Trim: This function in Canvas apps is used to remove any leading or trailing spaces from a text string. The syntax for the Trim function is:

Trim(Text)

Where ‘Text’ is the text string you want to trim.

For example, Trim(” Hello World “) would return the text string “Hello World”.


Substring: This function in Canvas apps is used to extract a portion of a text string, starting at a specified character position and with a specified length. The syntax for the Substring function is:

Substring(Text, Start, Length)

Where ‘Text’ is the text string you want to extract the substring from, ‘Start’ is the position of the first character to include in the substring (counting from 1), and ’Length’ is the number of characters to include in the substring.

For example, Substring(“Hello World”, 1, 5) would return the text string “Hello”, because it starts at the first character and includes the next 5 characters.


PadLeft: This function in Canvas apps is used to add a specified number of characters to the left side of a text string, padding it to a specified length. The syntax for the PadLeft function is:

PadLeft(Text, Length, Character)

Where ‘Text’ is the text string you want to pad, ‘Length’ is the total length of the padded string (including the original text), and ‘Character’ is the character to use for padding (optional, default is a space).

For example, PadLeft(“123”, 5, “0”) would return the text string “00123”, because it adds two “0” characters to the left of the original “123” text string to pad it to a total length of 5.


PadRight: This function in Canvas apps is used to add a specified number of characters to the right side of a text string, padding it to a specified length. The syntax for the PadRight function is:

PadRight(Text, Length, Character)

Where ‘Text’ is the text string you want to pad, ‘Length’ is the total length of the padded string (including the original text), and ‘Character’ is the character to use for padding (optional, default is a space).

For example, PadRight(“123”, 5, “0”) would return the text string “12300”, because it adds two “0” characters to the right of the original “123” text string to pad it to a total length of 5.


Find: This unction in Canvas apps is used to find the position of a specified substring within a larger text string. The syntax for the Find function is:

Find(FindText, TextToSearch, Start)

Where ‘FindText’ is the substring you want to find, ‘TextToSearch’ is the text string you want to search in, and ‘Start’ is the position to start the search from (optional, default is 1).

For example, Find(“world”, “Hello world”) would return the number 7, because the substring “world” starts at the seventh character position in the text string “Hello world”.


UnicodeToChar: This function in Canvas apps is used to convert a Unicode code point to its corresponding character. The syntax for the UnicodeToChar function is:

UnicodeToChar(UnicodeCodePoint)

Where ‘UnicodeCodePoint’ is the hexadecimal value of the Unicode code point you want to convert.

For example, UnicodeToChar(“0041”) would return the character “A”, because the Unicode code point “0041” represents the letter “A” in the Unicode character set.


CharToUnicode: This function in Canvas apps is used to convert a character to its corresponding Unicode code point value in hexadecimal format. The syntax for the CharToUnicode function is:

CharToUnicode(Character)

Where ‘Character’ is the character you want to convert to a Unicode code point value.

For example, CharToUnicode(“A”) would return the hexadecimal value “0041”, because the letter “A” has a Unicode code point value of U+0041 in the Unicode character set.


These are just a few examples of the many text formatting functions available in Canvas apps. By understanding how to use text formatting functions, you can create dynamic and visually appealing apps that display and manipulate text in a wide range of scenarios.


Posted

in

by

Tags: