# Query for Tasks with task variable name/value and 'like' condition

**URL:** <https://forum.flowable.org/t/query-for-tasks-with-task-variable-name-value-and-like-condition/1591>\
**Category:** Flowable Engine\
**Created:** [February 6, 2018, 3:53am UTC](https://forum.flowable.org/t/query-for-tasks-with-task-variable-name-value-and-like-condition/1591 "2018-02-06T03:53:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgrouch](https://avatars.discourse-cdn.com/v4/letter/m/cdc98d/32.png) [@mgrouch](https://forum.flowable.org/u/mgrouch)\
**Post date:** [February 6, 2018, 3:53am UTC](https://forum.flowable.org/t/query-for-tasks-with-task-variable-name-value-and-like-condition/1591/1 "2018-02-06T03:53:24Z")

</div>

Hello,

Query for Tasks with task variable name/value and ‘like’ condition always returns empty

> ```
> request.setIncludeProcessVariables(true);
> request.setIncludeTaskLocalVariables(true);
> QueryVariable user = new QueryVariable();
> user.setName("taskUsers");
> user.setValue("%|" + assignee + "|%");
> user.setOperation(QueryVariable.QueryVariableOperation.LIKE.getFriendlyName());
> user.setType("string");
> request.setTaskVariables(Collections.singletonList(user));
> 
> ```

I’ve tried it both with TaskQueryRequest and HistoricTaskInstanceQueryRequest.

In Admin UI I see task variables which should definitely match.

Thanks,  
–MG

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [February 6, 2018, 8:34am UTC](https://forum.flowable.org/t/query-for-tasks-with-task-variable-name-value-and-like-condition/1591/2 "2018-02-06T08:34:24Z")

</div>

Which database do you use?  
What’s the value - does it take in account case sentitivity?

We’ve got unit tests (e.g. [https://github.com/flowable/flowable-engine/blob/master/modules/flowable-rest/src/test/java/org/flowable/rest/service/api/runtime/TaskQueryResourceTest.java#L431](https://github.com/flowable/flowable-engine/blob/master/modules/flowable-rest/src/test/java/org/flowable/rest/service/api/runtime/TaskQueryResourceTest.java#L431)) that test this, hence my guess for a db specific thing.

---

<div class="post-metadata">

**Author:** ![mgrouch](https://avatars.discourse-cdn.com/v4/letter/m/cdc98d/32.png) [@mgrouch](https://forum.flowable.org/u/mgrouch)\
**Post date:** [February 6, 2018, 4:24pm UTC](https://forum.flowable.org/t/query-for-tasks-with-task-variable-name-value-and-like-condition/1591/3 "2018-02-06T16:24:44Z")

</div>

It doesn’t work when the string is \>2000 chars.  
Flowable stores its type as ‘longString’ and the value goes into different table where serializable types are stored. In Admin UI the type shows as ‘string’.

Thanks  
–MG
