# Decision table based on collection length

**URL:** <https://forum.flowable.org/t/decision-table-based-on-collection-length/8216>\
**Category:** Flowable Engine\
**Created:** [August 5, 2021, 7:13pm UTC](https://forum.flowable.org/t/decision-table-based-on-collection-length/8216 "2021-08-05T19:13:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MsMay](https://avatars.discourse-cdn.com/v4/letter/m/ec9cab/32.png) [@MsMay](https://forum.flowable.org/u/MsMay)\
**Post date:** [August 5, 2021, 7:13pm UTC](https://forum.flowable.org/t/decision-table-based-on-collection-length/8216/1 "2021-08-05T19:13:24Z")

</div>

I have a table with an array at root.members and I need to evaluate an expression based on the amount of members in the array. Specifically if root.members.length \>= 10.

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/flowable/original/2X/9/9d94ae4cffe0d95d9611756435b5f51d4a41a574.png)

---

<div class="post-metadata">

**Author:** ![jorge.mora](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/jorge.mora/32/694_2.png) [@jorge.mora](https://forum.flowable.org/u/jorge.mora)\
**Post date:** [August 10, 2021, 6:45am UTC](https://forum.flowable.org/t/decision-table-based-on-collection-length/8216/2 "2021-08-10T06:45:41Z")

</div>

Hi @MsMay ,

Please, have a look at this [DMN table with expressions](https://github.com/flowable/flowable-engine/blob/master/modules/flowable-dmn-engine/src/test/resources/org/flowable/dmn/engine/test/deployment/outcome_expression_1.dmn) and [the corresponding JUnit Test](https://github.com/flowable/flowable-engine/blob/97fe915e1d247c11983a4fc130efd2fb9ca1c447/modules/flowable-dmn-engine/src/test/java/org/flowable/dmn/engine/test/runtime/RuntimeTest.java#L191).

Flowable [supports JUEL expressions in DMN tables](https://flowable.com/open-source/docs/dmn/ch06-DMN-Introduction/#rules), but I’d suggest to prepare the required variables for the DMN table before. Expressions don’t make your DMN table more readable.

---

<div class="post-metadata">

**Author:** ![yvo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/yvo/32/2231_2.png) [@yvo](https://forum.flowable.org/u/yvo)\
**Post date:** [August 10, 2021, 7:32am UTC](https://forum.flowable.org/t/decision-table-based-on-collection-length/8216/3 "2021-08-10T07:32:48Z")

</div>

Hi,

in addition to the previous reply. You can define custom JUEL expression in the Decision Table editor by wrapping the expression between `${}` or `#{}`.  
Mind; you are ‘on your own’ it that case; the expression will executed as is; and the input variable defined in the column header is not used to form an expression. When the expression results in `true` the rule element is considered as valid.

So in your case an expression could be defined as;

```auto
${root.members.size() >= 10}

```

depending on the type of `members`.

Hope this helps.

Yvo
