Using FEEL list contains(list, element) function in gateway connectors

Hi !
I try to use list contains() function in gateway connectors condition expression. Need your advise.
The source data is like this:

var1=
{
 "documentDate":"2025-05-28",
 "executors":[{"executor":"1111111"},
 {"executor":"2222222", "mainExecutor":"1"},
 {"executor":"3333333"}]
}

When I try to make a condition expression like:
list contains(var1.executors.mainExecutor, "1")
it works fine.

But I can’t make working expression with more complex condition like:
list contains(var1.executors, {"executor":"2222222", "mainExecutor":"1"})
Could you help me, please ?

Hey Volodya, indeed the Context element does not get recognized by the “list contains” function. You could achieve what you are attempting by using the list filtering capabilities of FEEL and then checking if the returned list is empty or not. There might be a way to make “list contains” work as well but this is the first idea I had. Here’s an example:

2 Likes

Thank you, Vasil for your help. It looks like this is the right direction. But I can’t check your advise right now because Camunda 8.5, I’m using, don’t know about is empty() function.
I’ll think a lot and write my decision if I’ll find. Any other cool ideas - welcome ! :slight_smile:

No worries, FEEL offers options :wink:

3 Likes

Wow ! Thanks, Vasil for this solution. You are the Best ! It works.

1 Like