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

toUpper first letter, toLower remaining

Hello

 

I'm trying to make the first letter a capital and the remaining lowercase. The example first and last names are a mixture of upper and lower case. I can make the first letter a capital using the concat below but i'm unsure on how to apply to the second word.

Annotation 2020-05-28 181636.jpg

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @DanSessions ,

 

If your word would always be split by the space, you could refer to screenshot below to create the flow:

1.png

 

The expression in the Compose 2 as below:

split(toLower(outputs('Compose')),' ')

The expression in the append to array variable as below:

concat(toUpper(substring(items('Apply_to_each'),0,1)),substring(items('Apply_to_each'),1,sub(length(items('Apply_to_each')),1)))

The expression in the join action as below:

string(' ')

 

The flow would run successfully as below:

2.png

 

 

Best regards,

Alice   

Community Support Team _ Alice Zhang
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

5 REPLIES 5
Super User III
Super User III

Hi!

You can use split() function and space delimiter to store all the words as differnt element of an array. Then iterate throught all array elemnts by means of'Select' action block and manipulate all of them with your current formula, so your output array will have all words with first letter capitalized. Finally you can convert your output array back into a string by means of join() function

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!



Super User III
Super User III

@DanSessions 

Please see my example below.  I could have made this shorter but I spilt it out into multiple compose actions for clarity.  In addition, I convert the first letter to uppercase but I didn't convert the rest to lower case - that would be easy to do using toLower() inside of the concat() action.

UName1.jpgUName2.jpgUName3.jpgUNameLast.jpg

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Community Support
Community Support

Hi @DanSessions ,

 

If your word would always be split by the space, you could refer to screenshot below to create the flow:

1.png

 

The expression in the Compose 2 as below:

split(toLower(outputs('Compose')),' ')

The expression in the append to array variable as below:

concat(toUpper(substring(items('Apply_to_each'),0,1)),substring(items('Apply_to_each'),1,sub(length(items('Apply_to_each')),1)))

The expression in the join action as below:

string(' ')

 

The flow would run successfully as below:

2.png

 

 

Best regards,

Alice   

Community Support Team _ Alice Zhang
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

Community Support
Community Support

Hi @DanSessions ,

 

Have your problem been solved?

 

Best Regards,

Alice

 

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

Advocate III
Advocate III

It is mind boggling that Microsoft doesn't have a simple expression like they have in Excel to Capitalize the first letter of a word....   Very disappointed with the overall speed of development of power automate, so many lacking features (version history, empty array, etc...)

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (52,062)