Getting Started with Salesforce Flow – Part 79 (Salesforce Flow Naming Conventions)

Getting Started with Salesforce Flow – Part 79 (Salesforce Flow Naming Conventions)

Last Updated on November 21, 2021 by Rakesh Gupta

As a declarative programmer, you always want to create clean flows where naming has to be appropriate so that any other programmer can find it easier to read the flow and understand. 

Now, this may seem meaningless to you but think about a situation where you are investigating a flow to identify why it is failing at run time, and you’re unable to read it, as it doesn’t have naming conventions as well as documentation. 

Readability of flow is very important. It indicates that less time is spent to figure out what the flow does.

There are two items related to Salesforce Flow that are very important when it comes to readability and those are:

  1. Well Commented Flow
  2. Good Naming Conventions

A Well Commented Flow

Let us take a real-world scenario. While driving, you may have seen many signs on the road to help drivers – like signal, speed limit, milestones or route direction. When do we need/read signs? When things go wrong! As long as we’re chugging along happily, who has time to read signs?

Similar logic applies in the flow development and any programming. As long as flows or codes work, who reads comments? Challenges start when either – (1) the flow stops working; (2) customers want modifications to existing flows; (3), the flow is built by someone other than you; or (3) worse! – it could be your ancient, developing, self (oouch!).

Source: Internet

If you create flows to be consumed by other programmers first, and by the flow run time engine second, you may find the need for additional comments to be greatly reduced. How does a Salesforce Adminoloper comment on their flow?

  1. Beginner Adminoloper: comments explain how the flow works
  2. Experienced Adminoloper: comments explain why the flow works
  3. Hardcore Developer: comments explain why other implementations were not chosen

The following screenshot will give you some sense on what to write when it comes to adding comments in your flows.

Good Naming Conventions

In flow, it is good practice to name variables, data elements, logics and Screen elements that describe what they are actually supposed to do instead of naming them randomly.

Below are some naming convention suggestions for Salesforce Flow elements: 

Resources Naming Conventions

Resource Type Data Type Naming Convention

Examples 

Variable Boolean varB_<Short Description> varB_ReadyToInvest
Currency varC_<Short Description> varC_AnnualIncome
Date varD_<Short Description> varD_DateOfBirth
DateTime varDT_<Short Description> varDT_MeetingTime
Multi-Select Picklist varMSP_<Short Description> varMSP_Locations
Number varN_<Short Description> varN_RecordCount
Picklist varP_<Short Description> varP_Status
Record Collection Variable varR_<Object Plural Label> varR_Leads
Record Variable varR_<Object Name> varR_Lead
Text varT_Name varT_TravelDestination
Constant Constant con_Name con_PiValue
Formula Boolean forB_Name forB_ReadyToInvest
Currency forC_Name forC_AnnualIncome
Date forD_Name forD_NextFollowupDate
DateTime forDT_Name forDT_MeetingTime
Number forN_Name forN_RecordCount
Text forT_Name forT_OpportunityName
Text Template textT_Name textT_EmailBody
Choice choice_Status choice_Open
Record Choice Set recChoice_Name recChoice_OpenLeads
Picklist Choice Set picChoice_Name picChoice_StageName
Stage stage_Name stage_PersonalDetails

 

Data Elements Naming Conventions

Element Type Naming Convention

Examples 

Create Records Create <Object Name> or 

Create <Object Plural Label>

Create Contact or

Create Contacts 

Delete Records  Delete <Object Name> or 

Delete <Object Plural Label>

Delete Lead or

Delete Leads 

Get Records Get <Object Name> or 

Delete <Object Plural Label>

Get Lead or

Get Leads 

Update Records Update <Object Name> or 

Delete <Object Plural Label>

Update Quote or

Update Quotes 

Update Field Update <Field Name> to value Update Rating to Hot
Roll Back Records Roll Back Records Roll Back Records

 

Logic Elements Naming Conventions

Element Type

Naming Convention

Examples 

Assignment – Record Variable Set <Object Name> Fields  Set Account Fields 
Assignment – One Variable or Field Set <Field Name> to value Set Stage to Closed Won
Decision <Question> Ready to Close the Deal? 
Decision Outcome  <Answer>
  • Close Deal
  • Keep Deal Open
Loop Loop Through <Object Plural Label> Loop Through Opportunities 
Collection Sort Sort <Object Plural Label> Sort Contacts 

 

Interaction Elements Naming Conventions

Element Type

Naming Convention

Examples 

Screen <Short Description>
  • Collect Lead Details
  • Collect Policy Details 
Screen Components (For example, Name, Email, Phone, Checkbox, etc)  <Short Yet Meaningful Description>
  • Collect Lead Details Screen Components
    • CLD_Name
    • CLD_Email
    • CLD_Phone
    • CLD_Checkbox
  • Collect Policy Details Screen Components
    • CPD_Name
    • CPD_Email
    • CPD_Phone
    • CPD_Checkbox
Action <Brief Description> Submit Account for Approval
Subflow <Brief Description> Create Task
Parse Multi-Select Picklist

 

Flow Naming Conventions

Flow Type

Naming Convention

Example

Screen Flow Screen Flow: <Object Name> <Short Yet Meaningful Description>
  • Screen Flow: Order Fulfillment 
Record-Triggered Flow
  • Record-Trigger: <Object Name> Before Save
  • Record-Trigger: <Object Name>  After Save
  • Record-Trigger: <Object Name>  Before Delete
  • Record-Trigger: Order Before Save
  • Record-Trigger: Order After Save
  • Record-Trigger: Order Before Delete
Schedule-Triggered Flow <Object Name> Schedule: <Short Yet Meaningful Description>
  • Order Schedule: Send Monthly Invoices
Platform Event-Triggered Flow Platform Event-Trigger: <Short Yet Meaningful Description>
  • Platform Event-Trigger: Update PO on Quote
Autolaunched Flow
  • Subflow: <Short Yet Meaningful Description>
  • Subflow: <Object Name> Handler 
  • Subflow: Add to Slack Workspace
  • Subflow: Lead Handler
Field Service Mobile Flow Field Service: <Short Yet Meaningful Description>
  • Field Service: Complete Work Order
Salesforce Scheduler Flow Salesforce Scheduler: <Short Yet Meaningful Description>
  • Salesforce Scheduler: Outbound New Appointment
Omni-Channel Flow Omni-Channel: <Short Yet Meaningful Description>
  • Omni-Channel: Route Calls to Agents

Formative Assessment:

I want to hear from you!

What is one thing you learned from this post?  How do you envision applying this new knowledge in the real world?

Let me know by Tweeting me at @automationchamp, or find me on LinkedIn.

Proofreader: - Frances Barrera
Have feedback, suggestions for posts, or need more information about Salesforce online training offered by me? Say hello, and leave a message!

2 thoughts on “Getting Started with Salesforce Flow – Part 79 (Salesforce Flow Naming Conventions)

  1. Your naming convention for Currency should be varC_ instead of varB. But otherwise amazing artical. We just need everyone to follow and then working in Flows will be another step in the right direction.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.