Hello JM,
Regarding injecting a process variable into JS, you can directly pass the variable in the function call parameters.
Regarding extracting the value of a JS variable to a RMP variable, it is done by
setVariable("process_variable_name",js_function_result);
Regarding your application specific issue, i see you have correctly injected and extracted variables from JS so you need to debug yourself inside your function like just have
print(input);
print(start);
inside your script to see whether these variables have correct values or not and then write your actual function.
One thing I noticed from your input screenshot is that you have ${P_result.items} in Input variables which should have been an Output variable of a previous connector task that returned items.
Regards,
Pray Desai,
Fujitsu RunMyProcess.