How to count values of fields names with same prefix?

Hello guys,

I need to create a script field that counts values of fields with the same prefix:

SMF_001, SMF_002 ... SMF_300

How can I painlessly go through these fields? I imagine something like:

for (int i = 0; i <300; i ++) {
val = val + doc ['SMF_' + i] .value;

It is possible?

Thank you

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