web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : MT25/HTd1G2DJp9M3q7cXR
Power Automate - Building Flows
Answered

Capitalize single Letter Abreviations Error

Like (1) ShareShare
ReportReport
Posted on 30 Nov 2020 21:04:53 by 30

I'm pretty new to Power Automate so this is likely a pretty easy question but I'm struggling.

 

I have a flow I’m working on that will fill out a word document with some items from a Sharepoint list.

 

I noticed that the street addresses were all coming in as upper case and that does not make the forms look very professional.

 

So I needed to learn how to change the first letter to caps and the rest to lower case.

 

So I went searching and found this post

https://powerusers.microsoft.com/t5/Building-Flows/Capitalize-first-letter-in-string/td-p/241149

 

I also found this blog

http://benitezhere.blogspot.com/2020/10/how-to-do-proper-case-in-flow.html

 

So I decided to give the blog method a try.

 

And it worked the first few times I tried it.

 

Then I got to some addresses that had some single letter abbreviations.

 

Example: 7234 W MAIN STREET

 

The flow errors on the single letter abbreviation for west.

Main ErrorMain Error

I can see why it errors as the length of one minus 1 is not a valid length.

 

Any thoughts on how to fix it?

 

Some pics of my flow

Overall FlowOverall Flow

More FlowMore Flow

Getsvsaddr1 expression:

first(outputs('getdata')?['body']?['value'])?['ServiceAddress1']

 

addrtoarray expression:

split(toLower(outputs('getsvsaddr1')), ' ')

 

Here is where it fails

 

ErrorError

Expression for uppercasefirstletter:

concat(first(toupper(item())), substring(item(), 1, sub(length(item()), 1)))

 

I’m open to any other methods for doing this or suggestions on how to handle the single letter abbreviations.

 

Any help would be appreciated.

 

Thanks!

  • Paulie78 Profile Picture
    8,416 Moderator on 02 Dec 2020 at 21:22:00
    Re: Capitalize single Letter Abreviations Error

    @Kstuck wrote:

    I can't thank you enough Paulie78!

    I spent hours working on a new expression to get this to work and never did get it.

    Thanks again for your time and effort!

    It is greatly appreciated!

    P.S. Looks like I need to work on some of the forum features for posting code and flows.


    I think you do, you marked you own thank you message as the solution 🤣

  • Verified answer
    Kstuck Profile Picture
    30 on 01 Dec 2020 at 12:14:09
    Re: Capitalize single Letter Abreviations Error

    I can't thank you enough Paulie78!

    I spent hours working on a new expression to get this to work and never did get it.

    Thanks again for your time and effort!

    It is greatly appreciated!

    P.S. Looks like I need to work on some of the forum features for posting code and flows.

  • Verified answer
    Paulie78 Profile Picture
    8,416 Moderator on 01 Dec 2020 at 01:11:24
    Re: Capitalize single Letter Abreviations Error

    Quite an interesting question and your explanation of why it crashes is spot on. Both of the methods you linked would error in the same way. Check out the following flow. Slightly simpler, also does not error:

    CapitalizeEachWord.png

    The expression in "Capitalize each word" is:

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

    Explanation:

    Basically the same as before, but checks the length of each word, if it is only one character, then it just does "toupper". If it is more than one character is does all that concat business. 👍

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading complete