Answer
Check whether the variable is actually a JavaScript array (a multi-record collection) rather than a plain string — execution.getVariable() can return an array when the underlying workflow variable represents multiple records, and array objects don't have string methods like .substring() directly on them. If that's the case, index into the specific element you need first (e.g. SelectionTab[0].substring(...)) rather than calling the string method on the array itself. Also remember JavaScript method names are case-sensitive — substring (lowercase s) works, Substring does not.