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 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 Flow
More Flow
Getsvsaddr1 expression:
first(outputs('getdata')?['body']?['value'])?['ServiceAddress1']
addrtoarray expression:
split(toLower(outputs('getsvsaddr1')), ' ')
Here is where it fails
Error
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!