Advanced InDepth Salesforce Flow Interview Questions

What is difference between Use all values from Record and Use Separate Resource and literal values?

A screenshot of a computer Description automatically generated

A. Use all values from a record.

It means that you want to take all the field values from a specific record and work with them as a whole in your Flow. This is often used when you need to pass the entire set of data from one record to another or perform various actions based on all the values in that record.

Example Scenario:

Suppose you have a custom object called “Project” with multiple fields such as “Project Name,” “Start Date,” “End Date,” and “Status.” If you select option, you can work with all these fields as a group within your Flow. For instance, you might want to create a new task for a user when the “Status” of a project changes to “In Progress.” In this case, you would use all the values from the “Project” record to create the task without specifying individual fields.

B. Use separate resources and literal values:

– Option B allows you to choose and specify individual values, variables, or literal values that you want to use in your Flow. This is useful when you only need a subset of the data, want to combine data from multiple sources, or need to set specific values in your Flow.

Example Scenario:

Continuing with the “Project” object, if you select option B, you can choose specific fields to work with rather than using all the values from the record. For example, you might want to send an email notification to the project manager when the “Status” of a project changes to “Completed.” In this case, you would specify the “Status” field and the project manager’s email address as separate resources in your Flow.

How to Run a Flow in which mode?

  • System mode: In which the object and field-level permissions of the current user are ignored.
  • User mode: In which the permissions, field-level security, and sharing rules of the current user are enforced.
  • By default, Screen Flow runs in user mode. But Salesforce provides an ability to runs it in system mode.
  • Record-Trigged Flow always runs in system mode.
  • Scheduled-Trigged Flow always runs in system mode

How to change the context of Flow?

Click Show Advanced > How to Run the Flow, then you have two extra options – System Context with or without sharing.

launch context - change the context

Can you Debug Flow As Another User?

 You can test or troubleshoot a flow as another user in flow without having to login as that user. First, you need to enable the Enable user impersonation during debug run feature in Process Automation Settings. Note: You must have Manage Flow and View All Data permissions to impersonate other users during a Flow debug run. Then, check the option Run flow as another user and select the user you want to impersonate.

A screenshot of a computer Description automatically generated

How to Send Outbound Message with Salesforce Flow?

Outbound Messages send messages to external services

A screenshot of a computer Description automatically generated

How to Call a Subflow from a Record-Triggered Flow

It allows complex logic to be reused across multiple Record-Triggered Flows without having to be rebuilt each time.

A screenshot of a phone Description automatically generated

How to check flows which have failed in salesforce?

By using the ‘All Failed Flow Interviews List View’. This list view will show a list of any Screen Flow, Record-Triggered Flow, or Schedule-Triggered Flow that runs into issues, as well as any Autolaunched flows that aren’t triggered.

A screenshot of a computer Description automatically generated

How to build a multi column screen flow?

‘Sections’ allows you to configure your Flow Screens with multiple columns.

A screenshot of a computer Description automatically generated

How to pass record id from Lighting record page to Flow?

For this we need to select Flow Component on Record page

Select ‘Pass the record id into the variable’

A screenshot of a computer Description automatically generated

What are variables in flow?

In flows, think of variables as container to store data type. Variables can have their values referenced or modified during the flow.

Variables are created by clicking New Resource in the Toolbox section of the Flow Builder, and then completing the fields on the New Resource page.

What are Collection Variables?

A variable with “Allow multiple values (collection)” selected is known as a Collection Variable. They do not have default values but can be available for input or output. Collection Variables can be created like any other variable and are automatically created when a Get element is used to retrieve multiple records from the database.

A screenshot of a computer Description automatically generated

What is Record Variables?

Record Variables are a special type of variable because they contain an entire record and all of the field values on that record.

Record Variables can come from a few places:

1.You can create them like any other variable by selecting the Record data type

Create Account Record Variable

2. Alternatively, when you retrieve a single record with a Get element, the result is stored in a Record Variable. You can then reference and modify the values in that variable during the flow.

3. Record variables are also generated automatically when you create a record triggered flow. In these flows, the $Record variable holds the current values of the record that triggered the flow.

Edit Decision - Compare Owner ID

How to reference record variable?

Record Variables can be referenced in two ways:

1.They can be referenced in their entirety, which is usually done when placing them into collections of similar Record Variables or using them in a Create or Update element to create or update all of the values in the Record Variable.

Here, we use an Assignment to add an Account Record variable to a collection of Account variables:

Account Variable Collection

2.We can use the whole Account Record variable in an Update element. This works equally as well with Record Collection variables:

Update Records - Account Record Variable

3.You can also reference specific field values in Record Variables using dot notation, which references the record and a specific field connected by a period, such as “MyAccountVar.Id” to reference the Id field of an Account Record variable named MyAccountVar.

Edit Assignment

What is $Record__Prior variable?

$Record__Prior variable that holds the values of record before the update, which is useful for comparing the old values to the new ones in $Record.

What are Formulas in flow?

The main difference between flow formulas and formula fields is that in flows the formula resources reference the current value of other variables in the flow, whereas formula fields reference the current value of other fields on or related to their object.Both types of formulas change their values based on the values of the other values they reference.

Create Formula Resource - Date Data Type

The formula resource can then be used in an Assignment element to set the value of the field to the result of the formula: New Assignment - Set Variable Values

The ISNEW() Formula?

It is Formula resource of the Boolean data type with a formula that simply reads “ISNEW()” in the formula space. This formula will return a value of TRUE if the record that triggers the flow was just created, or FALSE if it was not. This Formula resource can then be used in Decision elements or other Formula resources as you move through the logic of your flow.

Boolean Data Type

 What is Create Records Element in Flow?

The Create Records element allows you to create new records in your Salesforce. It can be used to create one or multiple records.

1.When creating one record, the simplest way is to select “Use separate resources, and literal values.”

2.Choose the type of object you want to create a record for and assign the field values you want the new record to have.

3.Once the record is created this way, you also can reference the newly created Record ID in other flow elements.

You can also reference a record variable or collection of records used previously in the flow and create a new record using the values that were set previously. This is the only way to create multiple records with one Create Records element.

What is Update Records Element in flow?

The Update Records element makes changes to existing records.

What is ‘Use the IDs and all fields from a record or record collection’ in Update record element?

You can select “Use the IDs and all fields from a record or record collection” to update a record that was previously stored in the flow, such as one from a Get Records element.

Update Account Records

What is the Get Records element in Flow?

The Get Records element is used to “get” one or more records from the database based on filter criteria set in the component.

The filter criteria are based on values found on the specific record you’re getting, such as the ID or name of an account. Multiple records are stored together in a collection.

What is Delete Record element in Flow?

The Delete Records element is used to delete records from the database. You can either delete records stored in variables defined earlier in the flow, or specify the object and filter criteria needed to find the records you wish to delete.

Delete Records element will delete all records that meet the filter criteria.

Delete Records Element

What is an Assignment Element?

It is used to interact with records and resources within the flow by changing, adding, or subtracting the values of variables and fields. This is very useful for setting or changing record values before creating or updating them, and for using variables to perform logical functions.

Assignment Set Variable Values

What is Decision Element in flow?

It allows for the creation of multiple paths based on various criteria, allowing a single flow to output different results based on decision criteria.

When creating a Decision element, set the name and criteria for one or more outcomes. If the criteria is met in the flow, then the flow will follow the path for that outcome. If none of the criteria for the created outcomes are met, the “Default Outcome” is followed.

How to use Decision Element after a Get Element?

The Get Records element will not error out if it does not find anything with the filter criteria provided, but if later elements in the flow attempt to reference the record when there is not one, those elements may cause an error.

It is best practice to create a Decision element after your Get Records element to see if it found anything. Do this by checking if the variable from the Get Records element is not null.

What is Loop Element?

Although the Update Element does have the ability to modify more than one record by setting the filter criteria to find more than one record, with update records you are only able to make the same change to all of the records that meet those criteria.

Without loops, to update different records with different values based on logic, you need to create a number of Update Elements each with different criteria. Doing this can quickly cause you to hit flow limit errors with large datasets since Salesforce limits.

The best practice is to reduce the number of Data Elements as much as possible. When a loop is created, you must select a Collection Variable for it to loop through.

How loop Element works in Flow?

Create new loop element

Select Collection Variable

Once created, we can add other flow elements inside the flow after the “For Each” and before the “After Last.”

Flow Elements - Loop

1.Each element placed inside the flow will be run once for each item in the flow’s collection, allowing you to reference and modify them.

2.Elements inside the flow can reference a special variable called “Current Item from Loop (Loop_Name)” that holds the current item being processed by the loop.

3.Then, we’ll use an Assignment Element to update the field traveling through the flow

Assignment Element Loops

Assignment - Update Phone Number

4. We then create a new Collection Variable with the data type of Record.

Loop - Collection Variable

Assignment - Add to Update Collection

5.Next, create an Update Records element after the flow is complete to update the Collection.

Update Records - Collection

What is Collection Filter?

The Collection Filter is used to create a new collection variable that contains a filtered subset of an original collection’s contents.

When the element is configured, select the collection you want to filter, and set the conditions items must meet to be copied over to the new collection based on conditions or a formula evaluation as True.

A screenshot of a computer Description automatically generated

A diagram of a computer screen Description automatically generated with medium confidence

What is Collection Sort?

The Collection Sort element is used to sort the contents of a collection by ascending or descending order, and optionally reduce the number of items in that collection to a specified number. The Collection Sort element sorts record collection variables based on a field value in those records.

A screenshot of a computer Description automatically generated

We can also set collection size like below image, which means it will show 5 records based on criteria.

A screenshot of a computer Description automatically generated

What are choice resource types in Flow?

Choice resources have 4 types:

  • Choice – A single value defined in the flow the user can choose
  • Collection Choice Set – A set of values defined in the flow the user can choose from
  • Record Choice Set – A collection of records that meet a set of criteria, similar to a Get Records element that the user can choose from
  • Picklist Choice Set – A set of values that matches an existing picklist field in your org

Choice Resources

What is the lookup component in Screen Flow?

The Lookup component uniquely allows you to replicate an existing Lookup field in your Salesforce Org for use in Flow. When configuring the Lookup component

  • Set the API name of the component.
  • API name of the field you want to reference.
  • Label you want to display for the user on the screen.
  • API name of the Object the Lookup field is on
  • Can optionally set the default record for the component to display when the screen loads.

Salesforce Flows - Screen Lookup

How can we see screen components based on certain logic?

All screen flow components can also have their visibility set based on customized logic.

Salesforce Flows - Screen Address

What is Pause Element in Flow?

Pause element pauses a flow until a specified time or event before allowing the flow to continue. The flow transaction that started the flow ends when the flow is paused, and a new transaction is created when the flow resumes. This allows Pause elements to avoid hitting flow limits by pausing the flow when it might be close to hitting a limit and then resuming with new limits.

Salesforce Flows - Pause

Salesforce Flows - Pause Configuration

Salesforce Flows - Edit Pause

What are Action Element in Flow?

The Action element allows for standard or custom actions to be launched from the flow for a variety of uses.

Send Email action is used to send up an email

Salesforce Flows - Action

What is Subflow?

Subflows are a great way to reuse flow functionality without having to create the same or very similar flows more than once across your Salesforce Org.

When the Subflow element is used to call another flow, any variables within the Autolaunched flow marked as “Available for input” will appear in the Subflow element to accept input from values for the flow to use.

salesforce-flows-new-resource

We then create our first Flow Element using a Get element to retrieve the record for use inside our flow:

salesforce-flows-new-get-records

Once the autolaunched flow from the Subflow element runs, the original flow continues. All variables from the Subflow that are marked as “Available for output” can then be referenced as resources by the original flow.

Why set the automated process users email address in process automation settings?

There are a few reasons for setting the automated process users email address in Salesforce:

•Enables the automated process user to email out error logs from autolaunched flows

•Enables automated process user to send emails using email actions in flows

Set email for automated process user in salesforce

How To Display Current Date In Input Field On A Flow?

First, we need to drag the text input onto the screen, after that is done, we want to set the Default Value to the current Date.

We can type flow into the input and it will show the $Flow variable option, Select the $Flow option.

How To Get Current Date In Flow Text Input Example

How To Store Current Date In A Flow Variable

If we don’t want to have to keep accessing the current date through the $Flow object, we can set a variable to store the value and reference the variable instead.

How To Store Current Date In Flow Variable

 How To Add The Data Table Component To The Flow

We create a screen element and drag the Data Table component onto the screen. We can filter the components by typing Data into the search box.

How To Use Data Table In Flow Salesforce

Add Columns To List Of Records In Salesforce Flow

Output

How To Display List Of Records In Flow Salesforce Example

What are limitations of scheduled Flows in Salesforce?

Scheduled Flows allow admins to run declarative logic on multiple records at a predefined time and date. However the default frequency options for running a Scheduled Flow are Once, Daily, or Weekly.

A screenshot of a computer Description automatically generated

What are the considerations for scheduled trigger flow?

  • The org’s default time zone is used for the scheduled start time
  • The running user for scheduled flows is the Automated Process user
  • A scheduled flow will start at a specified time and frequency interval. Possible options include
    • Once
    • Daily
    • Weekly

How to extend the scheduling frequencies of a Scheduled Flow?

We Will create Scheduled Flow that is triggered to run daily, and as a part of its entry conditions, the Flow will only fire if the formula field we created evaluates to True on the correct days of the week. So, in essence you can think of this Flow logic as evaluating every day, as opposed to firing every day and if it’s the correct day, it will fire.

Execution Steps:

We will create a custom formula checkbox field that will be evaluated daily by a Scheduled Flow. In the below image, we can see formula field checks whether the day of the week corresponds to Monday (1), Wednesday (3), or Friday (5) and evaluates to True if so, and False if not.

How to use a formula field to run a scheduled flow on specific days

Configure the Schedule for the flow, we want to run it daily.

Setting Scheduled Flow to trigger daily

Adding Formula to Scheduled Flow

After setting the schedule we want the flow to first reference the formula field to check if the flow should run. We do this by opening Object and Filter Conditions as shown below

Setting the criteria for Scheduled Flow to check whether formula field checkbox is True

What are the considerations while creating screen flow?

When we are building a Screen Flow, as opposed to a record triggered or scheduled, we will need to capture the details of the record being used to launch the Flow. For this, we will create a text variable that will hold the Record Id of whatever parent Opportunity record we are working with.

From the toolbox bar, click ‘New Resource’ and input the below details:

1. Resource Type: Variable

2. API Name: recordId

3. Description: brief description of what this Variable is doing

4. Data Type: Text

5. Default Value: blank

6. Available for Input: enabled

Creating RecordId Text Variable

How to migrate from process builder to flows?

With Process builders and workflows being deprecated, there is more emphasis on making the switch to flows. Salesforce has a Migrate to Flow tool that can help make the switch to flows. The migrate to flow tool can now convert process builder processes into flows as well as workflows.

However, the migrate to flow tool only supports record-triggered processes as of now.

Below is a list of action types that can currently be migrated.

  • Record create
  • Record update
  • Invoke Flow
  • Invoke Apex
  • Email alert

A screenshot of a computer Description automatically generated

A screenshot of a computer Description automatically generated A screenshot of a video Description automatically generated

A screenshot of a computer Description automatically generated

What is the use of Multiselect component in flow?

From Winter 23 release onwards, we can now select multiple records in lookup components in a flow. To enable multiple selection, update the Maximum Selections field on the lookup to a value greater the 1.

This allows us to select multiple values and allow remove selected values for the lookup.

How To Make Lookup Component In Flow Multi Select

We can select multiple records here

Multi Select Lookup In Flow Example

How to display an image in Screen Flow?

In the Components list on the left look for Display Image. Drag the Display Image component onto the page.

Click on the Display Image component so we can configure it. Now fill in the API Name field. This is a unique name for the component.

Most important step, in the Image Name input put the name of the static resource you created which stores the image. Do not put the name of the image.

Salesforce Use Static Resource in Screen Flow

How to use IN Operator in Flow?

In Winter 23 Salesforce is releasing the IN and NOT IN operators in flows. This can greatly reduce logic and simplify queries.

Salesforce flow using IN Operator to find related contacts

How to retrieve record type id in Flow?

  1. We select the Record Type object
  2. Ensure All Conditions Are Met (AND) is selected
  3. Then we filter the Record Type object records by DeveloperName and sObject Type
  4. Select Only the first record for How many records to save
  5. How to store Record Data
  6. Select Choose fields and assign variables (advanced)
  7. Where to Store Field values
  8. Select In separate variables this allows us to select our text varaible we created earlier
  9. Next, we assign the Id of the record type to our text variable

1. Create a variable in the flow to store the RecordType Id

On the top left Click New Resources, from here we can create a text variable to store the RecordType Id

How To create a Flow Record Type ID variable

2. Use Get Records to retrieve the record type Id

Now we need to retrieve the record type Id, to do this dynamically we use the Get Records element.

Highlight how to get record type ID in a flow by using get records action

How to Log Emails Sent with the Send Email Action?

Automatically Log Emails: Previously, when users sent emails using the “Send Email” action in Salesforce, those emails were not automatically recorded or logged in the Activity Timeline of records i.e. When you send an email, it often relates to specific records in Salesforce. For example, you might be emailing a contact, an account, or an opportunity.

Activity Timeline: Salesforce has a feature called the “Activity Timeline” that keeps a record of various interactions and activities related to those records. This timeline includes emails, tasks, calls, and other activities.

Automatically Recorded: In the past, when you sent an email, Salesforce did not automatically add that email to the Activity Timeline of the corresponding records. This meant that the email was not visible within the Activity Timeline unless you manually logged or documented it there.

The activity composer and its activity tabs

With this new feature, users can now send emails using the “Send Email” action, and these emails will be automatically logged in the Activity Timeline of the recipient records. Recipient records include leads, contacts, and person accounts. This makes it easier to keep track of email communication with individual people.

3. Non-Recipient Records: Additionally, users can also choose to log these emails to non-recipient records, such as accounts or opportunities. This is helpful when an email is relevant to a specific account or opportunity and should be associated with it for reference.

4. Logging to Both: Furthermore, users have the flexibility to log an email to both recipient records and non-recipient records if the email is relevant to multiple records. This ensures that email communication is tracked comprehensively across different records.

Send Email action element edit window highlighting the Log Email on Send, Recipient ID, and Related Record ID parameters

How to call a Flow through a Quick Action?

A screenshot of a computer Description automatically generated

Inside flow, create a text type variable called recordId.

A screenshot of a computer Description automatically generated

In Get Records element, use the recordId

A screenshot of a computer Description automatically generated

What is the coverage percentage to deploy Flow?

In relation to the Apex tests, flow tests are not considered part of test coverage as in the 75%+ for prod deployment.

Do Flow Test provide code coverage like the test class does? If not we need to think of removing flow from test coverage?

Yes they do coverage by highlighting node by node.

Can you confirm if the flow test allows run bulk test?

No, it does not support bulk record testing. In most of trigger related scenarios, we have created individual record in test class and checking the test scenarios. If we replace those triggers with flows it wont be a big difference in test cases.

 

Did you enjoy this article?
Signup today and receive free updates straight in your inbox.
I agree to have my personal information transfered to MailChimp ( more information )
50% LikesVS
50% Dislikes