Are you tired of manually capitalizing the first letter of every name entry in your EspoCRM system? Do you find yourself wishing for a quick and efficient solution to streamline this process?
Let’s break down the formula script:
// Espocrm Formula String Upper Case First Letter
// ex: name = hello world.
// $firstLetterUpper = H
$firstLetterUpper = string\upperCase(string\substring(name, 0, 1));
name = string\concatenate(
$firstLetterUpper,
string\substring(name, 1) // the rest of the name string
);
Here’s how it works:
- We define a variable $firstLetterUpper to store the uppercase version of the first letter of the input string name.
- Using the string\substring function, we extract the first letter of the name string and convert it to uppercase using string\upperCase.
- Then, we concatenate the uppercase first letter with the rest of the name string, starting from the second character.
- Finally, we assign the modified name back to the original variable name, ensuring that the first letter is capitalized.