Routing - Get Records Node - Related Object Based Routing

Have more questions? Submit a request

Contents:

 

Overview

Related List/Object Based Routing (Get Records) allows you to query objects relevant to the record you are routing in your graph. With Related List/Object routing you can use related lists or SOQL queries to select records for decisions, actions, and routing. Using existing relationships with other objects gives you the ability to query and get records. Get Records is an advanced feature for admins with the need to access information through related Lists/Objects.

Example: Kevin is the LeanData Admin for OnPoint Communications. When a Lead is routed, Kevin wants to check the related List of Products. The lead is stamped with the products the Lead is interested in. The products can help determine the correct rep to route the lead.

Please Note: This feature is designed for advanced Salesforce users.

Matching to Related Lists

The most common type of setup and relationship that customers are enacting and executing on, is a related list. Using Related List Based routing enables you to use related lists on the routed record in your Flowbuilder Graphs. This feature is similar to Related Activity or Campaign Member based routing.

Leads in Salesforce typically have a related list such as a list of Activities inside Salesforce. John Smith might have multiple interactions with SDRs during the buying cycle. Those activities get logged under John Smith’s name.

These Activities (a Salesforce Object) have a lookup relationship to John Smith. The ID of John Smith will be stamped on these activities. We currently use the Related Activity Match node to navigate this relationship to route based on one of these Activities.

Use Cases

This section gives you several use cases to understand Related List/Object Routing.

Product Interest Based Routing

OnPoint Communications is a large software and hardware vendor. In Salesforce their products are stored on an object called Products. Leads and Opportunities can be stamped with the Product.

John Smith has indicated interest in products A,B, and C. If he expresses interest in another product, he can be routed to the rep that is trained in how to follow-up on his product interest. Related List routing would let us route based on most recent interest.

 

Enabling Custom Territories

GlobalWorld has a custom Territory object. They could also have a product like Enterprise Territory Management. They stamp the lead with the associated territory. Connected to the Territory is a related list of Territory members like an AE, SDR, and Product Specialist. Related List Routing will help us find the best match on the Related List of Territory Members.

Opportunities, Products, and Buying Groups

In this use case the Related List lives on the Opportunity that we match to instead of the routed Lead. Related List matching supports lists on the routed record but also lists on any other object in a Graph through matching. So we can query the list on the opportunity for products that John might be interested in. This is important to the buying group, because we can determine if John is part of the buying group for this Opportunity’s products or if he should be part of a buying group for a new Opportunity’s set of products. This feature allows us to check a list that lives on a matched object, not just the match object itself.

 

Nodes

Several nodes in FlowBuilder are specifically designed to help work with related Lists/Objects.

Get Records Match Node

The Get Records Match Node gives you the tools to identify related records. You will find the Get Records Match Node with the other Match Nodes on the Node Selector in your Router Graphs. You can customize the Get Records Match Node as needed. Options include:

  • Node Name
  • Find Records
  • Store Records
  • Set Variable
  • Advanced Settings

Node Name

By default, the Node Name is set to Match Node. You can change this label to anything you need. We strongly recommend giving this node a meaningful name such as the goal of the Match Node or simply Related List Match. This will help others understand the purpose of the node.

Getting a Record

There are 2 steps to configuring the node to get a record for routing purposes.

  • Step 1: Find Records
  • Step 2: Select and Store Record

In our example below we will mimic an Opportunity Match to demonstrate how the Get Records Match Node works.

Step 1: Find Records

What type of records (object) are you looking for?

You must first choose the object you want to access. The picklist will display all of the relevant Salesforce objects that can be queried. Select the desired object.

How do you want to Get Records?

There are 2 radio buttons under this option: Related List Search and SOQL Search.

Related List Search

This picklist will include the Routed Record and any Object Variables you have defined upstream in the graph. You can navigate through the Objects Related to these variables to find the Related List you desire.

 

If there is an Object that has a related list, such as the Matched Account, you may see it displayed twice on the Object picklist. If there is an arrow next to the Object, it means you can follow a lookup relationship to a different object. By following that relationship, you can select a related list on that next object. Selecting the option with no arrow will confirm that the related list you wish to use lives directly on that object.

SOQL Search

The SOQL Search option provides advanced querying capabilities using Salesforce Object Query Language. When selecting SOQL Search, you can:

  • Use the SOQL Builder tool to construct your queries without needing to know SOQL syntax.

Screenshot 2025-03-06 at 11.55.09 AM.png

  • Clicking the Build SOQL Conditions (or Replace Conditions) button will take you to a page where you can use dropdowns and operators to define your conditions, for which records you want to return. Once you complete your conditions, click the Create Conditions (or Replace Conditions) button to confirm your SOQL conditions.

Screenshot 2025-03-06 at 11.59.19 AM.png

  • Write custom SOQL queries in free-form mode (note: once you start typing in free-form, you cannot convert back to SOQL Builder)
    • Click Switch to Free-Form to directly enter your desired SOQL conditions into the text box

Screenshot 2025-03-06 at 12.00.34 PM.png

  • The root object type for your SOQL query must match the object you selected in the previous dropdown. If you change the object type after entering a SOQL query, your filters will be reset.
  • LeanData will return all records (from the root object) that meet your SOQL conditions. Note that these records don't need to be related to any Object Variables in your graph.
  • Please Note: LeanData can return up to 1,000 records before applying tiebreakers. Make sure your SOQL conditions are specific enough to return only the records you need within this limit.

Filter Records

  • The Filter Records section gives you the tools to Filter for just records that meet specific conditions or exclude records based on specific conditions. You can select No Filter if you do not need any filters.
  • Please note: if you had used SOQL Search to find records, the Filter Records section is unnecessary since filtering is handled directly within the SOQL query.

Step 2:  Store Records

The Store Records step gives you the tools to select either a single record or multiple records found in Step 1.

One Record

If you would like to find one related record, you will need to provide tiebreakers to enable LeanData to pick the best matched record when multiple matched records are returned. Click New Rule to add new rules. Use the drag handles on the left to re-order your tiebreaker rules.

Multiple Records (Collection)

If you would like to identify multiple records (called a Collection), you can select the Multiple records (Collection) option.

When using this option, LeanData can store multiple records for use in later decisions and actions. By default, LeanData can select up to 1000 records, but you can adjust this if necessary. In the case that there are more records than the limit specified, LeanData will select the records according to the sort order you specify, up to the limit. The Sort order will allow you to configure which priority the records will be selected in the case that more records than the limit are identified. Any records beyond the limit will not be included in the selection.

Set Variable to Selected Record

This setting can store the record or the collection in an existing Variable or a new Variable that you name. This Variable can then be used in later.

To set a Variable:

  • To save a new Variable, enter a new variable name. For new Variables you will see (custom) at the end of the name
  • Selecting an existing Variable will overwrite that Variable.
  • To set the variable, click on its name.

Advanced Settings

Node Edges

If selecting just one related record, there will be 3 exit edges from the Get Records Node. Under the Advanced settings you can select a target node for each of the edges for what you would like LeanData to do in each of these scenarios.

  • Match: LeanData has identified a best match based on the algorithm, after applying your Tiebreakers and Filters.
  • No Match: LeanData has not identified a match, after considering your Filters.
  • Multiple Matches Identified: When selecting one record, if LeanData has more than one match remaining after your Filters, and you would like to take a different action than identify one best match, you can direct this edge to your desired action. This option is disabled by default. If you had selected multiple records (or a Collection) in Step 2, this option will not be available.

Using Related Objects in the General Decision Node

If you need to reference fields on the related record identified in a Get Records Node, you can use the General Branch Decision Node. The General Decision Node has two main functions, it allows you to make routing decisions on any Variable in the graph and it can be used to make decisions with Get Records (Related Object/List Routing) results.

Example: Vince is the LeanData admin for Lighthouse Development. He currently needs to create a Graph that will use Get Records to get a Lead’s Product Interest stamped on the Lead. The Graph also needs to make routing decisions based on the Product Interest. Vince uses a General Decision Node to select the Product and route to reps that have the best product knowledge.

Screenshot 2024-03-01 at 2.56.02 PM.png

Compare Items

In the Compare Items section, you will be setting the items that you want to compare for the decision. You will be able to select the routed record, any matched Objects, or any saved Variable on the left side or right side.

To use a record identified in a previous Get Records node, find the Variable you used to store that record from the Get Records Node.

Whichever object variable you select for Item 1, the node will use that object’s fields for the routing conditions. For example, if you selected a Variable for an Opportunity identified with the Get Records node, the node will use those fields for the condition.

Configure the conditions as needed.

  • Select which field from the Object you wish to reference.
  • Select the Operator to use for comparing the field with the Value/Field of Item 2.
  • Select the Value or field from Item 2 (right side) to compare to Item 1. 

Set the target for the condition to indicate the next node this edge should proceed to, or End of Flow.

 

Actioning Records in a Collection

Within the Assignment or Routing Nodes or Update Record Nodes, you can select the Collections variable and LeanData will take the corresponding action on all the records that were stored in the Collection variable.

Actions taken on Collection records will be reflected as sub-logs of the primary routed record in the Audit Logs.

Please note: Actions taken on records in a collection will be processed in a separate transaction from the main record. Any field updates performed on Collection records will not yet be reflected in subsequent nodes.

 

Math and String Functions in Collections

When using Collections, you can leverage Math and String functions to calculate values, stamp them on fields and emails, or use them in routing logic. These functions enable you to:

  • Perform math calculations and manipulate string values directly within the FlowBuilder.
  • Use functions on variables or values, and stamp the output on record fields, variables, or emails.
  • Unlock roll-up value stamping and more advanced calculation-based routing logic.
  • Consolidate notifications by sending a list of updated records to the assigned owner in a single notification.

The following table shows the functions you can use with collections:

Function Syntax for Collection Variable Input 
(Math across the same field for all records)
Syntax for Specific Value/Variable Input
Calculate (+,-,*,/) Unsupported at this time [!CALC(({!x}+{!y}-{!z}))/{!a})]
Concatenate [!CONCAT({!Collection.stringfield},”required separator”)] [!CONCAT({!x},{!y},{!z}...,“required separator”)]
Sum [!SUM({!Collection.numfield})] [!SUM({!x},{!y},{!z}...)]
Average [!AVG({!Collection.numfield})] [!AVG({!x},{!y},{!z}...)]
Min [!MIN({!Collection.numfield})] [!MIN({!x},{!y},{!z}...)]
Max [!MAX({!Collection.numfield})] [!MAX({!x},{!y},{!z}...)]
Count [!COUNT({!Collection})] Unsupported at this time
Repeat (Text template for each Collection record) [!REPEAT({!Collection}, “text template”, “optional separator”)] Unsupported at this time

For example, if you wanted to include a list of all the opportunities within a collection that were assigned to a new owner, within a Send Notification node you can include the following syntax within the Message box:

This would produce an output of the following within the email notification:

 

Summary

Related List/Object Based Routing (Get Records) allows you to query any object relevant to the record you are routing in your graph and make routing decisions based on the results. You can store results in Variable to be used in your Router Graph


For questions or additional assistance please contact LeanData Support.

 

Articles in this section

Was this article helpful?
2 out of 2 found this helpful
Share