The toLower Function sets all items in a string to lowercase. There is the toUpper function also, and these functions are super useful, mainly if you collect information from a form from example. People tend to write differently, and having a function that magically transforms everything at once can make a world of difference.
Usage
It follows a simple pattern.
- String
Example:
String
'Manuel T. Gomes'
toLower(variables('String'))
will return
'manuel t. gomes'
Quite straightforward, right?
Limitations
It will take only uppercase characters that have an uppercase variant. For example, if you pass it “สวัสดี” (Hello in Thai) it will return the same thing with no error. The same if the string is already in lowercased.
Recommendations:
- When comparing strings, always use toLower to compare them properly. If you compare “Manuel T. Gomes ” and “manuel T. GOMES” the result will be false, although you may want the result to be the same. For example:
equals('Manuel','MANUEL')
will return false
equals(tolower('Manuel'),tolower('MANUEL'))
will return true
- Use it even if you don’t expect lowercase characters. For example, if you have a site only receiving information from Thai users, the names will, usually, don’t have an upper or lower case, but including the toLower can avoid issues in the future if something changes.
- In some instances, it’s useful to store one variant of this information. For example, when storing emails, always use a variant of the upper or lower case. It will keep the information consistent and easier to compare.
- Don’t nest it. There’s no real reason to do it but, if you find yourself in a situation where you have nested toLower functions in a formula, you should review it and make everything more straightforward.
Sources:
Microsoft’s toLower Function Reference
Back to the Power Automate Function Reference.
Photo by Vlad Tchompalov on Unsplash