Application Reviews: Flexible Decision Making With Flows
Updated: Oct 31
Hang on tight for some challenges at the end!
Business Case:
An application is available online for people to apply to a program offered by an organization.
Upon submission of this application, a record in Salesforce will be created containing the submission info. This info is stored across various custom fields.
The organization would like to simplify pre-qualified job applicants and they would like an easy way to be alerted if there are any concerns with the applicant's responses.
Examples:
Don't meet age requirement
Don't live or work in the same state/region as the organization
Don't have the time or availability to participate
Business Challenges:
The online application contains over 130 questions; therefore, the corresponding record in Salesforce has a lot of data.
Salesforce users would like a "single pane of glass" experience for understanding any of the reasons an applicant doesn't pre-qualify.
There are up to 30 combinations of unique criteria to pre-qualify and admit applicants.
For a more detailed look at this use case and how we addressed this process gap, head over to our case study here to learn more. This article; however, will take a more technical dive into how we used Salesforce to address the business need and the various challenges that came along with it.
Technical Requirements:
Application submissions will be pushed from FormAssembly to a custom object in Salesforce.
All combinations of criteria will be accessible from this custom object.
The evaluation process should be based solely on inputs from the applicant and not any inputs or adjustments made to the data by an internal Salesforce user.
If the combinations of criteria are true then create an "Alert" record in Salesforce that captures details about that information.
Decision criteria will only be based on the data populated in 1 or 2 fields.
In the future, a user with System Administrator permissions should be able to make adjustments to the criteria or add additional criteria with little to no support from a Salesforce Administrator.
Searching for up to 30 combinations of unique criteria to pre-qualify and admit applicants.
Where We Started:
Automation Tool = Record-Triggered Flow
Why?
The process is based on the creation of a record in Salesforce.
When will the process run = when the record is created and after the record is saved
Why at time of creation?
The application data that is pushed to Salesforce is based on inputs from an external constituent. This process should only be based on the inputs from the applicant and not any internal Salesforce users.
Why after the record is saved?
After-Save flows enable the ability to create a record in Salesforce. We need to create an Alert record in Salesforce any time certain criteria is met; therefore, this flow should run after the record in Salesforce is saved to the database.
Decision Criteria = captured in custom metadata
Why Custom Metadata?
The decision criteria will only be based on the data listed in one or two fields; therefore, there is minimal complexity to the decision criteria.
A user with System Administrator permissions should be able to make adjustments to the criteria or add additional criteria with little to no support from a Salesforce Administrator. Custom metadata will give these users the ability to adjust or write criteria on their own.
Under the Hood:
Now that you have some additional context on the business and technical requirements, let's take a look under the hood.
Follow Along:
Create Custom Metadata
The first step is to create the custom metadata. Please note that this is a simplified version. We included a few more fields in our solution for the sake of providing context to the end user and for more detailed reporting.
Setup
Custom Metadata Types
New Custom Metadata Type
Label = Application Query
Plural Label = Application Queries
Starts with a vowel sound = true
Object Name = ApplicationQuery (if you don't use PascalCase then Application_Query)
Create Custom Fields
Navigate to the Custom Fields section of your Custom Metadata's Settings
Select New
Field #1
Checkbox
Label = Active
Name = Active
Default Value = Unchecked
Description = checkbox used to determine whether or not the Application Query is active. If active then the custom metadata will be referenced in the flow Application: After Save - Created or Updated. If inactive, the custom metadata will be disregarded.
Select Save and New
Field #2
Text Area (Long)
Label = WHERE Clause
Name = WHEREClause (if you don't use PascalCase then WHERE_Clause)
Length = 32,768 (default)
Visible Lines = 5
Description = The conditions listed in this field will be used in the flow Application: After Save - Created or Updated. The WHERE Clause will be used to determine if the Application data matches the criteria in this field.
Field #3 (Optional)
Text
Label = Alert Reason
Name = AlertReason (if you don't use PascalCase then Alert_Reason)
Length = 255
Description = If the criteria defined in the WHEREClause__c field evaluates to true then the Alert Reason listed in this field will be used to provide the end-user some additional context as to why an alert was created.
Create Custom Object
Setup
Object Manager
Create -> Custom Object
Label = Alert
Plural Label = Alerts
Starts with vowel sound = true
Object Name = Alert
Description = Alert records will be used to record information regarding areas of an application that require further review by internal staff. The primary way Alerts will be created is from the Application: After Save - Created Flow. This object can be repurposed for other processes; however, this is the primary source for now.
Context-Sensitive Help Setting = Open the standard Salesforce.com Help & Training window
Record Name = Name
Date Type = Text
Allow Reports = True
Deployment Status = deployed
Launch New Custom Tab Wizard after saving this custom object = True
Select a tab when prompted. We are fond of the "alarm clock" option because who doesn't wake up to an alarm clock? Trick question!
Provide visibility to the tab on the next page
List which Apps in Salesforce will inherit your new tab
Create Custom Fields
Navigate to the Fields & Relationships section of your Alert Object's settings
Select New
Field #1
Data Type = Text
Label = Alert Reason
Length = 255
Name = AlertReason (Alert_Reason if you don't use PascalCase)
Description = If criteria is met to create an alert then the value in this field will be determined by what is listed in the corresponding custom metadata record from ApplicationQuery__mdt.
Select Next
Input field-level security
Add to Alert Layout
Create Custom Object
Setup
Object Manager
Create -> Custom Object
Label = Application
Plural Label = Applications
Starts with vowel sound = true
Object Name = Application
Description = Application records will capture responses from externally facing web-applications.
Context-Sensitive Help Setting = Open the standard Salesforce.com Help & Training window
Record Name = Name
Date Type = Text
Allow Reports = True
Deployment Status = deployed
Launch New Custom Tab Wizard after saving this custom object = True
Select a tab when prompted. We are fond of the "Form" option because an application is pretty synonymous with a web-form.
Provide visibility to the tab on the next page
List which Apps in Salesforce will inherit your new tab
Create Custom Fields
Navigate to the Fields & Relationships section of your Application Object's settings
Select New
Field #1
Data Type = Date
Label = Birth Date
Name = BirthDate (Birth_Date if you don't use PascalCase)
Description = Question on Application: Date of Birth
Select Next
Input field-level security
Add to Application Layout
Field #2
Data Type = Formula
Label = Age
Name = Age
Formula Return Type = Number
IF( NOT( ISBLANK( BirthDate__c ) ) ,
IF( DATE( 2000 , MONTH( BirthDate__c ) , DAY( BirthDate__c ) ) <=
DATE( 2000 , MONTH( TODAY() ) , DAY( TODAY() ) ),
YEAR (Today()) - YEAR ( BirthDate__c ),
YEAR (Today()) - YEAR ( BirthDate__c ) -1 ),
null)
Description = The calculated age of the applicant. Based on today's date and the date listed in the birth date field.
Select Next
Input field-level security
Add to Application Layout
Wahoo - give yourself a round of applause for making it this far! The preliminary items are done and now we're off to the fun stuff ... unless of course you enjoyed that exercise - our hat is off to you.
Install Package
For this particular solution, we can leverage UnofficialSF's installable Apex Action called ExecuteSOQL.
Create Custom Metadata Record
Create Flow
*Please note that the Flow name in the below video is Application: After Save - Created or Updated. This is because this flow will be repurposed for more business processes based on Application update. For the sake of this example, we're talking about Application creation.
You will need a few resources for this Flow. You can follow along with the video or create them ahead of time like so:
Resource #1

Resource #2

Resource #3

There you have it folks. You now have the tools you need to create an easier decision making process for your applications or however you decide to apply these concepts in the future. Here are some of the highlights of why this type of configuration will be beneficial:
Rather than having 30 different decision elements in your flow, you will have custom metadata that holds your decision criteria.
If you ever need to make adjustments to your criteria, you can simply update the WHERE Clause with these adjustments.
We recommend testing out your entire SOQL Query using the Query Editor in Developer Console and directly from your record-triggered flow.
It will be very easy and quick for you or another Salesforce user to make an adjustment, add additional criteria, or deactivate decision criteria.
Summit One's Challenge For You!
Challenge #1:
Create an alert every time an applicant indicates that they are not a resident of Nevada (our home base...shameless plug). The name of this alert should be called "Didn't Meet State Requirement."
Challenge #2:
Create a Screen Flow that presents alert information to users and allows users to update these two data points regarding an alert:
Notes (free text)
Status
Not Resolved (Default Value)
Resolved
Alert Name (Display Only)
This screen flow should be embedded at the top of the Application record page and should use Data Table to present the information to the user. If no alerts are created then display a banner that the applicant is eligible to be pre-qualified.
Challenge #3:
Adjust the Application: After Save - Created or Updated Flow to not execute the SOQL query inside of a loop.
Want to learn how we solved these challenges? Click here to find out.