Plus all value of specific field in list object using feel in dmn

Hi I have a list object like this
[
{“RoleCode”:“LNCO”,“RoleName”:“A”,“PerName”:“B”,“TotalMonthlyIncome”:40000000},
{“RoleCode”:“OWNE”,“RoleName”:“C”,“PerName”:“D”,“TotalMonthlyIncome”:5616622}
]
How do I archive sum all TotalMonthlyIncome field in this list using feel in dmn? Thanks

Hi @Mason_John,

Assuming we have a list named l, below expression should serve your needs.

sum(l.TotalMonthlyIncome)

Projection followed by Summation

https://docs.camunda.io/docs/components/modeler/feel/language-guide/feel-context-expressions/#projection

https://docs.camunda.io/docs/components/modeler/feel/builtin-functions/feel-built-in-functions-list/#sumlist

1 Like

Thanks for your response. I figure out how to solve my case declare this expression in dmn input column
sum(EventCriteriaPayIncomeDebtArrayList[(RoleCode = “LNCO” or RoleCode = “OWNE” or RoleCode = “NCTN” or RoleCode = “NBLA”) and TotalMonthlyIncome != null].TotalMonthlyIncome) and it run well :slight_smile:

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