Quick Salesforce Tip: Entity Definition

Quick Salesforce Tip: Entity Definition
Salesforce Screen Flow

If you're creating a screen flow that may live on several different objects and don't want to duplicate the flow, use the Entity Definition object.

Entity Definition Screen Flow

First, create a formula variable that grabs the first 3 characters of the recordId you pass in from the Lightning Page. LEFT({!recordId},3)

KeyPrefix Formula Variable

Then use that variable to get the "Entity Definition" record where the KeyPrefix equals your formula variable.

Get Entity Definition

Now you can then branch off of the Entity Definition result using the DeveloperName of the object instead of creating duplicate flows for each object.

Decision Element Branching on Entity Definition