# Feel expression to spilt and evaluate an array of strings

**URL:** <https://forum.camunda.io/t/feel-expression-to-spilt-and-evaluate-an-array-of-strings/54029>\
**Category:** Camunda 7 Topics\
**Tags:** dmn-engine-feel\
**Created:** [August 4, 2024, 1:58am UTC](https://forum.camunda.io/t/feel-expression-to-spilt-and-evaluate-an-array-of-strings/54029 "2024-08-04T01:58:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![venkyvb](https://forum.camunda.io/user_avatar/forum.camunda.io/venkyvb/32/12339_2.png) [@venkyvb](https://forum.camunda.io/u/venkyvb)\
**Post date:** [August 4, 2024, 1:58am UTC](https://forum.camunda.io/t/feel-expression-to-spilt-and-evaluate-an-array-of-strings/54029/1 "2024-08-04T01:58:16Z")

</div>

Hi,  
I have an input string array of fruits and quantities as CSV strings e.g. -

{\>

> “fruits”:[“apple,1”,“banana,2”,“pineapple,3”]  
> }

I want to make sure that the array always contains at least 5 apples and 2 bananas. I am able to do this with the following feel expressions -

> (some item in fruits satisfies (split(item, “,”)[1] = “apple” and number(split(item, “,”)[2]) \>= 5)) and (some item in fruits satisfies (split(item, “,”)[1] = “banana” and number(split(item, “,”)[2]) \>=2))

I am wondering if this is the right way of doing this predicate or are there better (or more idiomatic) way of doing this.

---

<div class="post-metadata">

**Author:** ![hassang](https://forum.camunda.io/user_avatar/forum.camunda.io/hassang/32/16498_2.png) [@hassang](https://forum.camunda.io/u/hassang)\
**Post date:** [August 4, 2024, 8:29am UTC](https://forum.camunda.io/t/feel-expression-to-spilt-and-evaluate-an-array-of-strings/54029/2 "2024-08-04T08:29:18Z")

</div>

Hi @venkyvb

I would use the same expression as yours.

---

<div class="post-metadata">

**Author:** ![system](https://forum.camunda.io/uploads/default/original/3X/5/8/58d50142eacca605d35cb1ef9e6b86ae85f49436.png) [@system](https://forum.camunda.io/u/system)\
**Post date:** [November 2, 2024, 8:29am UTC](https://forum.camunda.io/t/feel-expression-to-spilt-and-evaluate-an-array-of-strings/54029/3 "2024-11-02T08:29:34Z")

</div>

Closed on November 2, 2024, 8:29am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
