In the Camunda modeler I added a Dynamic List (key=dyn) with two fields (fieldA, fieldB) for each entry. In the first fieldA of each entry I want to enter a price, in the second fieldB of each entry I want to show a calculated value with a FEEL expression, based on the first field of the same index, let’s say field1 x 2.
This means a user add a first entry to the Dynamic List with fieldA[1]=13 and fieldA[1] shall become 26, on a second entry he enters fieldA[2]=20 and fieldB[2] shall become 40
How do I reference in my i-th field2 the i-th field1, i.e. the field1 of the same entry?
I know I can write stuff like dyn.fieldA[1] or dyn.fieldA[2], but this will reference hard-coded the value of the first or second entry.
Is there something like
“=dyn.fieldA[sameIndex] * 2”
which I can enter as a FEEL expression for fieldB ?
By chance I stumbled over the solution, I have to use the this
keyword:
=this.fieldA * 2
I think the documentation is missing this important piece of information. I neither found this in the docs of the FEEL expressions here What is FEEL? | Camunda 8 Docs
nor did I find it in the documentation of the Dynamic List, Tables (might be same use case), or contexts.
The only small hint is here Templating syntax | Camunda 8 Docs, but this is quite a different use case.
If anyone knows how I can request a documentation enhancement, then let me know. A co-worker was also looking into this problem and got stuck, too, so I think it’s not obvious.