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

Flow Designer – "Look Up Records" action - doesn’t allow “contains” or “starts with” operators

Snowman15
Tera Expert

Hi everyone,

I’m working on a flow where I’m using the Look Up Records action on the Email [sys_email] table. I want to filter records based on the Target table field so that it only returns emails where the target table name contains or starts with the word “software”.

However, when I add the Target table condition, the only available operators are is, is not, and is anything (see screenshot below). There’s no option for contains or starts with, which limits how I can filter dynamically by partial table names.

Is there any alternative approach or workaround to achieve this?

Any suggestions would be appreciated!

Snowman15_0-1759918649402.png

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Snowman15 

target_table is part of document ID field and hence that limitation.

use script and give this encoded query in condition and it worked for me

I used IN operator

AnkurBawiskar_0-1759919045722.png

 

Output: Count for matching records 3

AnkurBawiskar_1-1759919092134.png

 

Email log table with same filter also has 3 records

AnkurBawiskar_2-1759919121068.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Snowman15 

target_table is part of document ID field and hence that limitation.

use script and give this encoded query in condition and it worked for me

I used IN operator

AnkurBawiskar_0-1759919045722.png

 

Output: Count for matching records 3

AnkurBawiskar_1-1759919092134.png

 

Email log table with same filter also has 3 records

AnkurBawiskar_2-1759919121068.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Thanks that looks good. @Ankur Bawiskar 

I was wondering if there was also any other way to achieve this avoiding the scripting step as I have a few other conditions as well as the target table is software. Do you know if anything can be done with flow variables and then pass it only for that condition?

@Snowman15 

Glad to know that my approach worked for you.

Yes you can try to use flow variable but the issue is again the same.

the operator IN is not allowed, so I believe using scripting in condition is the only way forward.

1 thing you can do is -> store your tables in flow variables and use that flow variable in your condition script.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

M Iftikhar
Giga Sage

@Snowman15 ,

Flow Designer’s Look Up Records action exposes reference-type operators (is, is not, is anything) — it doesn’t allow string-based operators like contains or starts with since it expects a specific referenced record rather than a text match. 

You can add a inline Script action after your Look Up Records to filter the results programmatically.

 

Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.

Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.