+ Start a Discussion
Gary WGary W 

Lead Record Type Returning NULL in Flow

My flow is occasionally encountering an issue where the Lead's RecordTypeId is null, when it should have a real record type ID value.

I have three custom record types set up on the Lead object, so as far as I'm aware, the record type should never be null.

My flow starts off like this: 
User-added image
The ID of the lead to get is provided as an input variable.

Occasionally encounter an issue like this where the 'Get Record Type' element encounters a null:
 
How the Interview Started
User started the flow interview.
API Version for Running the Flow: 49
Some of this flow's variables were set when the interview started.
VarLeadID = 00Q3j00001PoMiyEAF

GET RECORDS: Get_Lead
Find all Lead records where:
Id Equals {!VarLeadID} (00Q3j00001PoMiyEAF)
Store the values of these currently referenced fields in Get_Lead: Status, ConvertedAccountId, Sourced_by_Partner__c, Partner__c, Sent_to_Partner__c, Region__c, ConvertedContactId, Referral_Email__c, OwnerId, RecordTypeId, Trial_Start_Date__c, Country, Id, Salesperson_Referral_Link_Used__c, ConvertedOpportunityId, Referral_Code__c
Because Get_Lead is passed to an action, subflow, or Lightning component, store the values of all Lead fields that the running user has access to.
Result
Successfully found records.

GET RECORDS: Get_Record_Type
Find all RecordType records where:
Id Equals {!Get_Lead.RecordTypeId} (null)
Store the values of these fields in Get_Record_Type: Id, DeveloperName
Result
Failed to find records.

Looking at the lead record, it has a valid record type ID. Why is it null when the flow executes?
ShirishaShirisha (Salesforce Developers) 
Hi Gary,

Greetings!

Seems like the flow is running in user Mode and the user might not have access to the record type due to which they are unable to pull the records based on that specific recordType.

I would suggest you to check the permissions for the running user and make changes accordingly.

Reference:https://automationchampion.com/tag/run-a-flow-in-system-mode/

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

Warm Regards,
Shirisha Pathuri
Gary WGary W
In this case, the user running the flow is an Admin, and definitely has access to the record types.