cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
admincaleb
Frequent Visitor

Capitalize first letter

I have an action that gives me a first name, but I'd like to capitalize the first letter to make it more formal for automated email messages.  I know of toUpper, but I'm not sure how to make it only toUpper the 1st index (the first character) and nothing else.

 

Right now, I have a compose that can be called via outputs('HTML_TO_TEXT_PARSE').

 

I'm able to grab the first name by doing first(split(outputs('HTML_TO_TEXT_PARSE'),'.')) but cannot figure out how to capitalize ONLY the FIRST letter.

 

Flow does the following:

email comes in >> first.last@domain.com >> flow pulls out everything from the beginning of the string until the period >> first >> I'm failing to capitalize the "f" in "first"

2 ACCEPTED SOLUTIONS

Accepted Solutions
v-bacao-msft
Community Support
Community Support

 

Hi @admincaleb ,

 

Please try to use this expression:

102.PNG

Expression reference:

concat(first(toupper(split(outputs('Compose'),'.')[0])),substring(split(outputs('Compose'),'.')[0],1,sub(length(split(outputs('Compose'),'.')[0]),1)))

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

admincaleb
Frequent Visitor

Found a previous post and used this:

 

concat(first(toupper(outputs('HTML_TO_TEXT_PARSE_FIRSTNAME'))),substring(outputs('HTML_TO_TEXT_PARSE_FIRSTNAME'),1,sub(length(outputs('HTML_TO_TEXT_PARSE_FIRSTNAME')),1)))

I had tried it prior to starting this thread, but flow wouldn't take it.  After about 5 page refreshes it finally took and works fine.

 

Thank you for the responses. 

View solution in original post

5 REPLIES 5
abm
Super User III
Super User III

Hi @admincaleb 

 

Please refer this post

 

https://powerusers.microsoft.com/t5/Building-Flows/Split-string-into-array-of-characters-empty-delim...

 

This will convert your string to array. Then update the first index using toUpper expression. Finally convert the array back to string using concat.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials
ChristianAbata
Super User II
Super User II

Hi friend @admincaleb  try 

trydis.PNG

Then just concat the capitalice letter with the rest of the string. 

substring(outputs('Compose'),1,sub(outputs('Compose_2'),1))

 



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
v-bacao-msft
Community Support
Community Support

 

Hi @admincaleb ,

 

Please try to use this expression:

102.PNG

Expression reference:

concat(first(toupper(split(outputs('Compose'),'.')[0])),substring(split(outputs('Compose'),'.')[0],1,sub(length(split(outputs('Compose'),'.')[0]),1)))

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

efialttes
Super User III
Super User III

Hi

Let's assume you have stored the string you want to capitalize its first letter in a variable called 'currentString'

 

If so, I would combine first, skip, toUpper, and concat functions as follows:

concat(toUpper(first(variables('currentString'))),skip(variables('currentString'),1))

 

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



admincaleb
Frequent Visitor

Found a previous post and used this:

 

concat(first(toupper(outputs('HTML_TO_TEXT_PARSE_FIRSTNAME'))),substring(outputs('HTML_TO_TEXT_PARSE_FIRSTNAME'),1,sub(length(outputs('HTML_TO_TEXT_PARSE_FIRSTNAME')),1)))

I had tried it prior to starting this thread, but flow wouldn't take it.  After about 5 page refreshes it finally took and works fine.

 

Thank you for the responses. 

View solution in original post

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (87,268)