December 20, 2024

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.

  1. 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:

  1. 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
  1. 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.
  2. 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.
  3. 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

Manuel Gomes

I have 18 years of experience in automation, project management, and development. In addition to that, I have been writing for this website for over 3 years now, providing readers with valuable insights and information. I hope my expertise allows me to create compelling, informative content that resonates with the audience.

View all posts by Manuel Gomes →

Leave a Reply

Your email address will not be published. Required fields are marked *

Mastodon