People have various opinions about naming conventions for Salesforce variables in flows. Some draw their opinions from old VB code, others from C or Java.

As a previous C developer, below is my approach, which follow specific design patterns.

1. Keep it simple and concise
If a variable name can be written shorter, then shorten it
E.g.: `this_is_the_account_name` can safely be shortened to `AccountName`

2. Keep it clear
If a variable name is very short, or only has meaning to you, then it’s probably too short or too vague.
E.g.: `Number` probably isn’t explicit enough, but `Count` is OK (if you’re counting records)
E.g.: `MulOfCofAddToIntRt` is unreadable (any guesses what this is supposed to represent?)

3. Use the UpperCamelCase notation
E.g. `OpportunityId` and `HappyHappyDate`, not `opportunity_id` or `Happy_Happy_Date`

4. Prefixes are for formulas and choice variables only
E.g.: The `var` in `var_Account` doesn’t add any value
E.g. `fContactId` is clear

5. The name should be representative
If you’re storing an Id, use `Id`. If you’re storing a Name, use `Name`
E.g. `ContactId` should store the Id of a contact record, and nothing else

The takeaway
Using this approach keeps things orderly and lean. Keep in mind you’re not building flows for yourself. You’re building them for the people supporting the system.

Whatever approach you use, just stay consistent.

Category:
Salesforce