The CreatorCon Call for Content is officially open! Get started here.

Decision table is not reading the entire string when I use 'contains' in the condition

poorva1
Tera Contributor

Hi everyone,

I am using Decision table in a flow designer to set the assignment group and subcategory based on the mailbox address. The mailbox has multiple addresses and hence I am using the 'contains' when I am building the condition in the decision table. 

When I use the “contains” condition in a Decision Table (for example: checking if a string or list contains a certain value), it only matches when the value appears first in the string or comma-separated list and is not giving any output if the string does not appear first. 

 

Has anybody run into this issue before? Does anybody have any pointers for me to try?

 

Thanks in advance.

 

 

 

9 REPLIES 9

Hi @Ankur Bawiskar,

I did try to test it and returned empty result when the value is not the first in the string.

 

Thanks!

Connectmustaq
Tera Expert

Hi @poorva1 ,

 

The issue you're experiencing with the Decision Table "contains" condition in ServiceNow Flow Designer—where matching only occurs if the value is first in the comma-separated list—is a known limitation of how Decision Tables process string or list input with "contains" in this context. The "contains" operator on a string or comma-separated field does not always parse the list as an array and may behave as a strict "starts-with" function, especially when the Decision Table input is treated as a simple string, not an actual list/array.

 

Why This Happens

  • Decision Tables in ServiceNow do not natively tokenize or split comma-separated lists for "contains" searches as arrays—each row's field is simply matched as a substring, leading to the issue where only the first entry matches.​
  • If your mailbox field contains a value like "address1@example.com,address2@example.com" and your Decision Table checks "contains address2@example.com", it will not match unless "address2@example.com" is the first value or if the condition is set up to properly handle the delimiter

Workarounds and Best Practices

1. Scripted Logic in Flow or Script Include
2. Loop Over Each Value
3. Normalize Data Structure
4. Custom Contains Logic
To resolve the issue, either split the value into an array and check each value separately before sending to the Decision Table, or use a custom script to robustly check for a "contains" match within the comma-separated list. This will ensure decisions work regardless of the value's position in the field.

If it is helpful, please hit the thumbs button and accept the correct solution by referring to this solution in the future it will be helpful to them.

 

Thanks & Regards,

Mohammed Mustaq Shaik

Thanks, @Connectmustaq ,

Let me try this. 

Deepak Shaerma
Kilo Sage
Kilo Sage

Hi @poorva1 

Have you tried to change the condition to Run all the decisions that matches. if not, give it a try.
Screenshot 2025-10-16 at 10.13.15 AM.png

Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help us a lot.
Thanks & Regards 
Deepak Sharma

HI, @Deepak Shaerma ,

Let me give this a try. 

 

Thanks!