Here is a quick question: What is the best way to test for the presence of an Id? For example, if you have a flow that may or may not receive an Id from the calling source, how do you know if you received on or not? Or, how do you know if the ParentId on an Account record (or AccountId on a Contact or Opportunity record) is populated or not?
The first thought that comes to mind is to see if the Id is an empty string:
Unfortunately this solution doesn’t always give you consistent results. Grrr. 😦
So here’s a quickie tip:
Create a function that returns the length of the string, then check to see if the length is greater than zero: