function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jacob RauchenJacob Rauchen 

Flow - how to stop get record error when no lookup exists

Hi, we have a flow that updates a lookup field for zip codes based on another existing text field.
On occasion, the text field value does not have a matching record for the lookup field and so the flow fails on that record and sends an error email that it failed to find the record, which we are trying to avoid.

Here is what my configuration for the Get Record element looks like: User-added imageI tried using the checkbox to set the variable to null if no record is returned but in the error emails it appears that the flow is still using the text field value that had no matching lookup. Maybe my configuration above is not correct.

Any help or suggestions would be appreciated, thanks!
ShirishaShirisha (Salesforce Developers) 
Hi Jacob,

Greetings!

You can add the decision to check,if the value matches then only perform the next actions otherwise,exit the flow without throwing any error.

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
Jacob RauchenJacob Rauchen
Hi Shirisha,

What value would I have to check with the decision element?

I thought that my filter condition would check if a record exists with that name.

Thank you.
Jacob RauchenJacob Rauchen
As an example, if the text field value is '00000', the flow will fail because we do not have a zip record that matches '00000' since it is not a legitimate U.S. zip code. Checking if the text field is null will not work because it has a value, the value just has no match. I want the flow to continue if the Get Record fails.