Well, the transform has to return some value. If you have a Contact item, what state do you want it to be in if the string “qwr” isn’t present in the input string? The change you made above is missing a parenthesis, for one thing. I don’t know if this will work the way you want it to, because I’m not sure of what you want. But please study this variation:
(function(w,start,end) {
if (w.indexOf("qwr") > -1) {
return w.substring(start, end) === "0" ? "CLOSED" : "OPEN";
} else {
return ""; // no idea if this is what you want
}
})(input,9,10);
Please read up on JavaScript programming from any of a number of helpful web sites. I think, once you’ve gotten proficiency there, you can carry on solo! All the best!