Salesforce Flow·

Ayoub Naming Convention For Flows

Flows should be readable and clear, more important than anything else!

Flows can get complex

With Power Comes Complexity

You could go from building a simple button to send an email, to communicating with another system, to building a massive Intake Form.

You always need to think about the future Salesforce Admin. After you complete this amazing flow, someone else in the future will need to open it to fix a bug or add functionality. When you (I mean, when that person) opens that flow after a year or two, they need to understand what goes where.

Similar to spaghetti code, there are spaghetti flows. If you don't know what I am talking about, you must be using Auto-Layout :)

a readable and clear flow is the best of flows

I personally follow the following naming convention for flows:
(This is just my way, you don't have to agree with it, but I am telling you, it saves lives.)

I will share my reasons and why this way of naming is awesome at the end!


Resources

Variables

VariableTemplateSingle or CollectionExample 1Example 2
TextTxtVar_SomeKeywordSingleTxtVar_AccountNameTxtVar_FirstName
TextTxtVar_GroupingName_KeywordSingleTxtVar_OppRecordTypeId_DonationTxtVar_OppRecordTypeId_MajorGift
TextTxtColVar_KeywordCollectionTxtColVar_AccountNamesTxtColVar_OpportunityIds
RecordRecVar_KeywordIsKeywordSingleRecVar_AccountRecVar_Opportunity
RecordRecColVar_KeywordsCollectionRecColVar_AccountsRecColVar_Opportunities
NumberNumVar_NumberOfKeywordSingleNumVar_NumberOfEmployeesNumVar_NumberOfDonations
NumberNumColVar_KeywordCollectionNumColVar_NumberOfEmployeesPerCompany
CurrencyCurrVar_KeywordSingleCurrVar_OpportunityAmount
CurrencyCurrColVar_KeywordCollectionCurrColVar_OpportunityAmounts
BooleanBolVar_KeywordIsKeywordSingleBolVar_AccountIsAddedToCollectionBolVar_IsNew
BooleanBolColVar_KeywordCollectionBolColVar_CultivationChecks

You get the idea for the rest of the data types

Constants

TemplateExample
Const_SomeKeywordConst_PricePerBook

It is even better to have this set outside of flows in a custom metadata or custom settings to allow editing this value without editing the flow itself

Formulas

Return Data TypeTemplateExample
Textfx_txt_Keywordsfx_txt_AutomatedOpportunityName
Numberfx_num_Keywordsfx_num_UpdatedNumberOfEmployees
Currencyfx_curr_Keywordsfx_curr_NewOpportunityAmount
Booleanfx_bol_Keywordsfx_bol_IsMajorGift
Datefx_date_Keywordsfx_date_NextYear
Date/Timefx_dateTime_Keywordsfx_dateTime_SameTimeTomorrow

Text Template

TemplateExample
TxtTmp_KeywordsTxtTmp_EmailBody

Choice

TemplateExample
Choice_KeywordChoice_Yes

Collection Choice Set

TemplateExample
CCS_KeywordCCS_Categories

Record Choice Set

TemplateExample
RCS_KeywordRCS_Accounts

Picklist Choice Set

TemplateExample
PCS_KeywordPCS_OpportunityStages

Stage

TemplateExample 1Example 2
Stage(Number)_KeywordStage1_GettingToKnowYouStage2_EducationHistory

Elements

Screen and Screen Components

TypeTemplateExample
ScreenKeyword ScreenContact Information Screen
Display TextDispTxt_KeywordDispTxt_Instructions
DatatableDatatable_KeywordDatatable_Accounts

For other screen components, I just name them without a prefix
Example Text Input: What is your First Name?

Actions and Subflows

Starts with a verb such as "Set Account Name" or "Send Amount to Fundraise Up"

Assignments, Get, Update, Create, Delete, Loop, Sort and Filter

Starts with Assign, Get, Update, Create, Delete, Loop, Sort and Filter

Decision

Always starts with a verb in the form of a question
Always a Yes/No type of question

TemplateExample 1Example 2
YesNoQuestionFoundAccount?BusinessAccount?

Decision Outcomes

The Default Outcome is always a "No" because I only use Yes/No Decisions

For the Yes Outcome though

TemplateExample 1Example 2
Yes_SameDecisionAPINameYes_FoundAccountYes_BusinessAccount

Hungarian Notation

Adding a prefix to the variable names is called "Hungarian Notation". Hungarian Notation is a naming convention used in computer programming where the name of a variable or function indicates its type or intended use.

Icons in Flows tell the Data Types

Every data type has an icon that helps you identify the data type.

variablesIcons

So, what is the point of using a Hungarian Notation?
Sometimes the icon doesn't tell you exactly what this data type is, or you need more information about this variable type or use.

Text vs Formula with Text

Even though these are 3 different resources, they all have the same icon.

sameIcon


The WHY

  • Find any resource or element you need by searching for the shared keyword
    • Find all formulas by searching for 'fx'
    • Find all text data type formulas by searching for 'fx_txt'
    • and so on
  • Keep every element and resource name unique, you don't have to have "Yes" and "Yes0" and "Yes00" and "Yes000" anymore.
  • Distinguish between single and collection variables with the keyword "Col".
  • Resources are sorted alphabetically, resources that share the same prefix are grouped together.
    • Example: TxtVar_OpportunityRecordType_Donation is better than TxtVar_DonationOpportunityRecordType because all record types will be grouped together right below each other and won't be separated with other resources such as Dress Code.

txtVarGrouped

  • I prefer Txt over T and Var over V as a single letter is not very telling, and making it a full word is very long. "Var" is in the middle between "V" and "Variable".

By the way, I don't fully support the argument of "Flow like code" because of one very big fat reason that some Salesforce pros often just forget:

The target audience

Flows are made for Salesforce Admins and End Users. As Salesforce consultants, we share flows with customer admins and end users and sometimes we have to open the flow to show them how something works or if something needs to be updated in the future if ever.

(We should definitely give them a way to edit outside the flow but I am just saying it happens that we share screens and show the flow to a customer)

Most of the customers I worked with (40+) didn't hire a Salesforce admin. One of the team members would wear the hat of a Salesforce admin and most of the time, that is in addition to their previous role. No matter how tech-savvy that person is, you are not talking to a Salesforce Developer.


Conclusion

Keep it simple, keep it readable, keep it clear!!!