var str = event.source.source.documentfilename;
var strt = str.lastindexof("_");
event.value = str.charAt( strt + 1); // if always a single character
Note that JS supports both substring and substr:
str.substring( start, end ) -- gets character starting at start through end MINUS 1.
"abcdef".substring( 2,4 ) would be "cd"
str.substr( start, length ) -- get characters starting at start for given length
"abcdef".substring( 2, 3 ) would be "cde"
character positions start at zero, not 1 as in VB derivatives.
In both of those, if you omit the second argument, you get from start to the end of the string.