We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Confuing for loop error

EJ13
Tera Contributor

Hi all, I've been getting the following error caused by a for loop I wrote. The loop is part of an "Update Record" action that I've scripted in Flow Designer. Does anyone know what might be causing it? The script is searching for a string in a large inputted description, with the possible strings to find in an array I've created. However, the error seems to think there's a syntax error and I can't find it.

EJ13_0-1722952770736.png

EJ13_1-1722952901468.png

 

2 REPLIES 2

Vasu ch
Kilo Sage

Hi @EJ13 ,

 

Try replacing let with var.

 

Regards,

Vasu Ch

Sandeep Rajput
Tera Patron

@EJ13 Replace let with var in the for loop.