Cert++
Close

Null values from Get Records causing flow failures

Key Takeaway

When a step depends on a value that can be null, such as a Get Records filter value, put a Decision element before that step. The flow then runs the step only when the value exists.

The Get Records element pulls Salesforce records into a flow, but it can come back empty. When it does, a value the flow expected is blank, or null. If a later step depends on that missing value, such as a filter condition or an email recipient, the flow fails. Troubleshooting means finding where the null came from and adding a check so the flow acts only when the value exists.

How Get Records brings data into a flow

A flow isn't connected to your org's data on its own. The Get Records element finds the records that meet its filter and sort conditions. Get Records then stores their values in flow variables, so later elements can make decisions or update records with that data.

Get Records can store any of these:

  • Only the first matching record
  • All matching records
  • All records up to a limit you set, between 2 and 20,000

Suppose Get Records uses "Choose fields and assign variables (advanced)" and no records match the filters. The flow retrieves nothing, so the variables meant to hold the field values are empty or null.

Sorting can also bring a blank value into the flow. In an ascending sort, null values come first because they count as the smallest possible values. In a descending sort, null values come last. So if Get Records stores only the first record after an ascending sort, the stored record can be one with a blank sort field.

Platform Administrator II Study Guide

Checklist progress

0/290Learned

Given a scenario, identify the appropriate tool or method for troubleshooting declarative automation

0/13

Prepare for the Exam

Play Today's Certle

Study Community

Ask questions and get the latest info from other Platform Administrator II studiers.