Input default variables in Script block

I tried to keep the SOURCE variable as the input variable in Script but it gave me this error:

Here’s what I did:

Can this be done without any errors?

lolicode:--------------------------------------------------------------------->
if (data.SOURCE.Contains(“keyX”))
{
}
else if (data.SOURCE.Contains("keyY))
{
}
else
{
}

interop-Jint:---------------------------------------------------------------->
the error is saying that data object is not defined
you can fix it by declaring a constant string with the value data.SOURCE .
now change the input from data.SOURCE to the variable name you created

You cannot use composed variables (the ones that have a dot) as input variables, please use a constant string and reassign data.SOURCE to some other variable e.g. SOURCE and pass that one.

1 Like