Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Input is not defined Mobile App Builder

Valentin Virot
Tera Expert

Hi everyone!

 

I have a pretty annoying issue while editing the Now Agent app on my instance. When I create an input form to get a date, and then use a script action item, everytime I try to use my function in the app, an error messages appears saying "Failed!".

 

The only log that I have in the instance is:

 

 

 

com.glide.script.RhinoEcmaError: "input" is not defined.
sys_sg_write_back_action_item.4bf6ec2b1b80fd906551dceacd4bcb60 : Line(4) column(0)
1: (function WriteBackAction(input) {
2: //Type appropriate comment here, and begin script below
3: gs.info("test log");
==> 4: })(input);

 

 

 

If i remove the input variable from the WriteBackAction method, the error disappears, but then I can't access my inputs.

 

Any ideas?

 

Thanks!

1 ACCEPTED SOLUTION

Valentin Virot
Tera Expert

Hi everyone, I found the issue. This method signature seems to be invalid by default on the instance. Instead of WriteBackAction(input), you should use this (it works for me):

 

(function WriteBackAction(parm_input, parm_variable, actionResult) {
	// Write your code here
})(parm_input, parm_variable, actionResult);

View solution in original post

2 REPLIES 2

Valentin Virot
Tera Expert

Hi everyone, I found the issue. This method signature seems to be invalid by default on the instance. Instead of WriteBackAction(input), you should use this (it works for me):

 

(function WriteBackAction(parm_input, parm_variable, actionResult) {
	// Write your code here
})(parm_input, parm_variable, actionResult);

anandman3g
Tera Contributor

Thanks Valentin. It is indeed weird