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
Sunita PhadnisSunita Phadnis 

Check for Null values for ID in Visual workflows

Hello Everyone,

I have created a flow to lookup a lead, the lead exists, I want to update the email and if the lead is not found create a new lead record. The update is working properly but I'm unable create the record.

Here are some screenshots.

User-added image

CheckLeadID is a formula:
User-added image

Thank you for all your help.
Best Answer chosen by Sunita Phadnis
KnowledgeseekerKnowledgeseeker

A few things i see here; 1) At the very bottom of your lead record lookup component there is a checkbox "Assign  null values to the variable(s) if no records are found" make sure this is checked so it will assign "null" to your {!SFLeadID} variable when no records are found. Then 2) Delete your Formula "CheckLeadId", you're assigning null to your variable aleady and so the formula is redundant. 3) In your decision element, you only need 1 "outcome" call it "No Lead" and have your outcome logic say the following; Resource: {!SFLeadID} Operator: ISNULL Value: {!$GlobalConstant.True} . finally 4) When mapping your decision paths make your "No Lead" path go to updating the email and your default path go to creating a new lead. Let me know if you run into any road blocks. - Jeremy

All Answers

KnowledgeseekerKnowledgeseeker

A few things i see here; 1) At the very bottom of your lead record lookup component there is a checkbox "Assign  null values to the variable(s) if no records are found" make sure this is checked so it will assign "null" to your {!SFLeadID} variable when no records are found. Then 2) Delete your Formula "CheckLeadId", you're assigning null to your variable aleady and so the formula is redundant. 3) In your decision element, you only need 1 "outcome" call it "No Lead" and have your outcome logic say the following; Resource: {!SFLeadID} Operator: ISNULL Value: {!$GlobalConstant.True} . finally 4) When mapping your decision paths make your "No Lead" path go to updating the email and your default path go to creating a new lead. Let me know if you run into any road blocks. - Jeremy

This was selected as the best answer
Sunita PhadnisSunita Phadnis
Hey Jeremy,

This solution was perfect!! Thank you!