# Tasks with candidate group or no candidate group

**URL:** <https://forum.flowable.org/t/tasks-with-candidate-group-or-no-candidate-group/4827>\
**Category:** Flowable Engine\
**Created:** [November 6, 2019, 5:10pm UTC](https://forum.flowable.org/t/tasks-with-candidate-group-or-no-candidate-group/4827 "2019-11-06T17:10:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthew](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Matthew](https://forum.flowable.org/u/Matthew)\
**Post date:** [November 6, 2019, 5:10pm UTC](https://forum.flowable.org/t/tasks-with-candidate-group-or-no-candidate-group/4827/1 "2019-11-06T17:10:07Z")

</div>

I’d like to create a taskquery that returns all tasks with a candidate group that I will provide or without any candidate group. So something like:

List candidateGroups = Arrays.asList(“curators”, “”); // so the curators group or an empty string to indicate no candidate group  
List tasks = taskService.createTaskQuery().taskCandidateGroupIn(candidateGroups).list();

Is this possible does anyone know?

Thanks in advance, Mat

---

<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:** [November 7, 2019, 9:37am UTC](https://forum.flowable.org/t/tasks-with-candidate-group-or-no-candidate-group/4827/2 "2019-11-07T09:37:54Z")

</div>

No. having no group would be null in the database so the empty string won’t work. Right now, the only way is probably by doing 2 queries.

---

<div class="post-metadata">

**Author:** ![Matthew](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Matthew](https://forum.flowable.org/u/Matthew)\
**Post date:** [November 7, 2019, 10:54am UTC](https://forum.flowable.org/t/tasks-with-candidate-group-or-no-candidate-group/4827/3 "2019-11-07T10:54:28Z")

</div>

Thanks @joram ! Do you know what he query would be to get tasks with no candidate group then? I tried taskService.createTaskQuery().taskCandidateGroup(null).list() which caused an exception and also with an empty string which I now know wont work. Thanks again - Mat
