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!
2 ACCEPTED SOLUTIONS

You are mapping the contact from the inputs of your subflow. Rather, you should add the contact reference from the step "Create Contact Record".

 

If my response has helped you , kindly mark it as helpful and accept the solution.

Regards,

Nayan

View solution in original post

@swethavelu 

when you create Case you are giving wrong input for Contact Field

You should pass the Contact Created SysId in previous step as input in Contact field

See below -> get the contact sysId using data pill and set here

AnkurBawiskar_0-1766048260410.png

 

 

💡 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

View solution in original post

8 REPLIES 8

@swethavelu 

Hope you are doing good.

Did my reply answer your question?

💡 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

Hi @Ankur Bawiskar 

 

Thank you for your response. Based on your suggestion, I’ve moved the case creation logic to the else block instead of checking with “If No exist.” In this block, I’m creating both the Contact and the Case. However, I noticed that the Case is not associated with the Contact, and similarly, the Contact is not linked to the Case. Could you please advise what I might have missed?
Fyi,
swethavelu_1-1766047679255.png

 

swethavelu_0-1766047652656.pngswethavelu_2-1766047769209.png

 

You are mapping the contact from the inputs of your subflow. Rather, you should add the contact reference from the step "Create Contact Record".

 

If my response has helped you , kindly mark it as helpful and accept the solution.

Regards,

Nayan

@swethavelu 

when you create Case you are giving wrong input for Contact Field

You should pass the Contact Created SysId in previous step as input in Contact field

See below -> get the contact sysId using data pill and set here

AnkurBawiskar_0-1766048260410.png

 

 

💡 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