• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Tachytelic.net

  • Sco Openserver
    • Sco Unix Support
    • SCO Openserver Installation ISOs
    • SCO Openserver Binaries
    • Add a Hard Drive to an Openserver 5 Virtual Machine
    • Install SCO Vision SQL-Retriever ODBC Driver on Windows 10
    • License Expired on Virtual SCO Openserver Installation
    • How to reset the root password on SCO Openserver 5
  • Scripting
    • PowerShell
      • Add leading zeros
      • Check if a File Exists
      • Grep with Powershell
      • Create Environment Variables
      • Test for open Ports
      • Append to a Text File
    • VBScript
      • Check if a File Exists
      • lpad and rpad functions
      • Windows Update E-Mail Notification
  • Office 365
    • Connect to Office 365 with PowerShell
    • Add or remove an email alias using Powershell
    • Change Primary email address of Active Directory user
    • How to hide an AD user from the Global Address List
    • How to hide mail contacts from the Global Address List
    • Change the primary email address for an account with PowerShell
    • Change Primary email address of an AD User
    • Grant a single user access to access to all calendars
    • Forward email to an external address using Powershell
    • Convert shared mailbox to user mailbox with Powershell
  • Get in Touch
  • About Me
    • Privacy Policy

How to create Proper Case Strings in Power Automate

December 2, 2020 by Paulie Leave a Comment

Sometimes strings in Power Automate need to be reformatted so that the first letter of each word is capitalized. This is know as “Proper Case”. There is no function built in to perform this common task. PowerApps does have this function so I expect it will arrive on Power Automate eventually.

In the mean time, here is an example flow and the required code to convert a string to Proper Case. The goal is to transform the sample string “this is a TEST” to “This Is A Test”

Example Proper Case Flow

Proper case is simple to achieve, take a look at this sample flow:

Image of a Flow in Power Automate that converts a string to Proper Case (Capitalizes each word).

Explanation:

  • The phrase to be transformed is added to a compose step.
  • An apply to each is started and the input is a split expression which splits the phrase into an array.
  • Each word is then passed into an expression which makes the first letter of the word uppercase and the remainder lower case.
  • The final step of the flow uses a join expression to put the phrase back together again with spaces between each word.

The expression in the flow step “Capitalize each word” is:

if
(
  equals(length(item()),1),
  toupper(item()),
  concat(first(toupper(item())),toLower(substring(item(),1,sub(length(item()),1))))  
)

Explanation of the expression:

  • If the length of the word is only 1 letter, just output the uppercase representation of the word.
  • If the word is longer than 1 character then uppercase the first letter of the word and lowercase the remainder.

I decided to write this up after someone asked how this could be done on the Power Automate community forums. He was following a blog post written by Elaiza Benitez that performs the same function.

My flow is mostly the same, but also works when one of the words has only one letter.

Hope this helps you out until the Power Automate team add a Proper Case function.

Related

Filed Under: Power Platform Tagged With: Power Automate

Reader Interactions

Leave a Reply Cancel reply

Primary Sidebar

Power Automate Support Image
Link to my LinkedIn Profile
Go to mobile version