Thanks for the answer – it clears up a lot of my uncertainty!
Unfortunately when I used the code with my own eui and payload substituted in, the debug terminal diplays – syntax error: unexpected token ILLEGAL. I am very much a newbie in javascript syntax and can’t seem to find the error?