Flow Designer Subflow: “If Contact Exists” Condition Always Evaluates False After Contact Creation

swethavelu
Tera Contributor

Hi Community,

I’m working on a Flow Designer subflow that handles Contact and Case creation when a new email is received via the email channel in ServiceNow CSM.

Here’s the logic:

swethavelu_0-1765863334976.png

 

swethavelu_1-1765863364064.pngswethavelu_2-1765863390129.png

Below condition is evaluated as false, even new contact record is created.

swethavelu_3-1765863482121.png
When I test the flow manually, I see:
Lookup Records Count = 0 Condition: 0 = 1 → false
So it goes to the Else branch instead of the “exists” branch.
 

Goal:

I want the flow to:

  • Create a Contact if it doesn’t exist.
  • If it exists (or after creation), proceed with Case creation using the correct Contact.
Any best practices or examples for handling this scenario in Flow Designer would be greatly appreciated!
 
Thanks in advance!
4 REPLIES 4

Hemanth M1
Giga Sage
Giga Sage

Hi @swethavelu ,

 

That's correct, because you're referring to step number 8 in step number 11 to check if the contact exists or not, so it says 0. (its a initial check)

Option 1) You check the contact table with the incoming email again in step number 11 and, based on the count, create the case.
Option 2) Move your "create case" block inside the first if after contact record creation, so that if the contact doesn't exist, it will first create the contact and then create the case.

 

Hope this helps!

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

Bshirisha
Tera Contributor

Hi @swethavelu ,

I would suggest creating simple flow itself 

Screenshot 2025-12-16 at 12.24.15 PM.png

nayanmule
Tera Guru

In the 'If loop' itself where you are checking that the Contact not exists, you can create a contact and create a case immediately. 

 

Or else you can use the lookup records again before step11 and check if the contact exist or not. Usually, it will return as true since it's already created in the step above (provided if there are no errors).

 

Mark my response as helpful and accept the solution if it helps.

Regards,

Nayan

Ankur Bawiskar
Tera Patron
Tera Patron

@swethavelu 

you already have IF for Not Exists, then simply use ELSE for that

Why again to use IF logic?

The reason why it might be failing is you are checking Count = 1 inside IF, there could be multiple contacts with same Email.

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader