Hello All
I have simplified the example data for illustration.
I am trying to process a file that has field names F-1 to F-15. I want to populate a JavaScript field with the contents of one of the fields F-1 to F-15 if it contains the letter B. The first “B” to be found should end the loop.
I can create a script with multiple “if then else” statements but feel a loop would be simpler but sadly I get an Error running script (Undefined script result (DME000018)) (DME000019)
My script is as follows, if anyone has any pointers please do share. My JavaScript skills are still being developed, maybe you can tell?
for(let i=1;i>=15;i++) {
if (record.fields[“F-” + i].includes(“B”))
{ record.fields[“F-” + i]
break
} else { “” }}
Many Thanks