“I’d like to standardise the data I receive and make the first character always upper case, what’s the easiest solution in Power Automate?”
When you collect data from various sources, the format can be quite different. Some system can have the information in upper case, some in lower case, and some in a variation of both. Yet for the users it should always look the same. How do you standardise the text format? To make only the first character upper case and all the rest in lower case?
Split the text into 1st character and the rest
Since you’re trying to apply different format on the first character, you must isolate it from the whole text. As such you must split it into two pieces – the first character and the rest.
The easiest way to take the first character is to use the take(…) expression. This expression can be used on strings or arrays and will return the desired number of items / characters.
Note: <…> are placeholders, replace them including the < and >.
Here you want only in the first character.
As an example, if I want to standardise the statuses in an approval process, it could look as below:
take('new request', 1) = 'n'
That’s the first character, now for the rest – the remaining text without the first character. To do that use another expression that’s often used together with take(…), the skip(…) expression. While take(…) will take a number of characters and ignore the rest, skip(…) will skip a number of characters and take the rest.
In this case you want to skip only the first character.
skip(<string>, 1) skip('new request', 1) = 'ew request'
Make the text upper or lower case
Now, when you have the two pieces of text for different formatting, you can apply the upper / lower case. The first character should be upper case…
…the rest should be lower case…
…and it should be concatenated back into a single string.
concat(toUpper(take(<string>, 1)), toLower(skip(<string>, 1)))
The most complicated part on making the first character upper case in Power Automate is to isolate it. Luckily, Power Automate has two expressions that make this task very easy. Take(…) the first character, skip(…) it to take the rest, and apply the toUpper(…) or toLower(…) expressions to format the text.