When data is sourced from a webform and inserted into Salesforce, it can be dirty.
Ideally, the source system has sufficient data validation in place to avoid the really dirty errors. For example, ensuring an email address has the correct format.
When entering free text however, such as people’s names, things get tricky. For some reason I still cannot figure out, some people still like to write their names in full capital letters.
If controlling input at the source is not possible, it’s your job to clean and format it as best as possible in Salesforce.
Using the name example, there are two main ways to format the data into Title Case.
Method 1: Flow
Since flow can’t easily iterate over characters, you need to treat the name as a collection of words. First, split the words by looping through each word and formatting it using a formula field. Then stitch the words back together again.
Method 2: Apex
A tiny invocable apex class can be created using AI. This class can then be easily called by a flow and return the formatted name.
This class could be later augmented to handle other kinds of case, like Sentence case or camelCase.
The takeaway
Just because you don’t know apex doesn’t mean flow is the right tool for every jonb. Using AI to write helper classes is now painfully easy.