Flow

Flow is a powerful business automation tool that can manipulate data in Salesforce in a variety of ways. Such an application can be created right from the org’s set up with just drag-drop/point-click. The ease of creating flows makes it the number one go-to tool when it comes to complex business requirements.

How do flows work in Salesforce?

 Flows can look up, create, update, and delete Salesforce records. They can also create Chatter posts, submit records for approval, and send emails. If your action isn’t possible out of the box, call Apex code from the flow. Connect your flow to an external database by using core actions or Apex actions

Webp.net-resizeimage_15

 

What Features are included?

  Flow Designer, we get 3 tabs: palette; resources; explorer.

Palette

 Palette gives access to a number of elements that can be used to build the logic.

The main elements are as follows

User Interface element Screen – Users can interact with the Flow only through this element. It lets the flow -collect information from the User and pass it to other elements for processing

Logic Elements:

    Decision – helps to determine the direction of the flow

   Assignment – can set, change, add values of/to variables

   Loop – iterates through the values of a collection variable

DML operations:

Record Create/Update/Lookup/Delete –the names speak for themselves. We can look for and Delete records right in here (codeless Heaven for Admins).

Fast Create/Update/Lookup/Delete – these are doing almost the same things as elements above but by using only sObject variables. Using Fast elements helps to bulkify the transaction.

For example, if there are 50 records that need to be updated, then it is better to have a Fast Update element to update 50 records at once, instead of having        Record Update run 50 times, which increases API calls to the database.  

Then we have Flow elements that list all the flows that we have in our org. This helps to nest flows within each other.

Email Alerts

 you know this one ? all email alerts that are being used in workflow rules and process builder in your org are included in this section 

flow1

Quick Actions– every single quick action that has been created in your org is available within the flows

Resources – these are used to collect, store, and pass the data within or outside of the application. Based on the demand we can choose one of the resources below

Variables – Changeable resources that can be updated within the flow, or from outside (passing value through URL, Visualforce page). Used for passing values throughout the flow.

Collection variables – does the same trick as variables, except as many values within the same data type can be stored in this resource.

sObject variables – changeable resources where we can store a record of a specific object type, when stored in sObject variable all the fields of that record can be accessed through the same variable.

sObject collection

flow2

Variables  Stores multiple records of a specified object type, this resource can be used to Fast Delete, Fast Update, and Fast Create records.

Stage (Beta)

 Newly added (Spring 18’) resource that used to indicate the Stage of the process/flow where the User at;

Constant -fixed value can be used throughout flow;

Formula – Dynamically creates value with the help of other resources in the flow.

Text template – Formatted text, the best part of this, HTML code can be used here (we will talk about it in the future);

Choice – individual choice option;

Dynamic-record choice – A very powerful resource. Shows a filtered list of Salesforce records to the user, and stores one record that the user chooses;

Picklist choice

 Salesforce picklist or multi-select picklist can be stored here for use in the flow;

 Note: Most of these resources are familiar to power-users but I would like to encourage you to research and learn more about sObject variables and dynamic-record choice resources, those come in handy in some pretty complex cases.

How are Flows run?

The awesomeness of the Flow does not end there, another perk is it can be run from almost everywhere. However, to determine where to run them we need to know the flow types, there 2 main types:

Screen Flows

    • as the name suggests includes screen element to gather information from a user, this means that the flow type requires user interaction. This type of flow can be accessed in a number of places: custom button; custom link; direct URL, Visualforce Page, or Salesforce app action.Note: Wait element is not available here.

Auto launched
Run in the background with no need for user interaction. It still can run everywhere that Screen Flows run, in addition, we can run it from process builder and Apex. The official Visual Workflow Guide says Workflow action is in the pilot so I guess it will be available for public use in the future, and then we will be able to run auto launched flows even from workflow rules. Note: The screen element is not available here.

Conclusion

Flows include a lot of powerful features that would be useful in every single org.DML operations include Flow.

Leave a Comment

Your email address will not be published. Required fields are marked *