Action Item: Access Inputs from Parameter Section in Script

Roy Wallimann
Tera Contributor

Hi ServiceNow Community

In an "Action Item" (sys_sg_write_back_action_item) it's possible to access Inputs from "Input form screens" (sys_sg_parameter_screen) with "parm_input" in the Execution Script.

When the input is referenced to a "Parameter Section" (sys_sg_parameter_section), "parm_input" is not working.

I haven't found any information in the docs, how an input from a Parameter Section can be accessed.

Thanks in advance!

Regards,

Roy

10 REPLIES 10

Roy Wallimann
Tera Contributor

I had created a Case in Now Support and they provided me the solution:

You can access "Parameter Section" inputs using this syntax:
parm_input['<ParameterSectionName>.<InputName>']
parm_variable['<ParameterSectionName>.<VariableName>']

Where:
<ParameterSectionName> is a value of Name field that goes from sys_sg_parameter_section_m2m table
<InputName> - a name of the input that is connected with the current Input Form Section
<VariableName> - a name of the variable that is connected with the current Form Section

E.g.
parm_input['testSection.testInput']

@Roy Wallimann - can you give more context for this?  I'm trying to use this since I've been unable to write a 'Script' of Action that actually works.  Could you layout what you did with a working example?

 

Thank you in advance!

Hi Shane

Sure, I give you an example:

1. On the "sys_sg_parameter_screen" Record, create an "Input Form Sections" Record

RoyWallimann_0-1674110391184.png

2. Open the created "sys_sg_parameter_section_m2m" Record and click on the magnifying glass

3. Create a new "sys_sg_parameter_section" Record and click on Submit (or select an existing one)

4. Create Inputs and Variables for your Input Form Section

5. Now you can access the Input and Variable Values in the Action Item. E.g. "gs.addInfoMessage(parm_input['test_section.test']);"

"test_section" is the "Name" from the "sys_sg_parameter_section_m2m" Record and "test" is the Name from the Input on the "sys_sg_parameter_section" Record. You can access Variables from the "sys_sg_parameter_section" Record with "parm_variable" instead of "parm_input".

Hope this works for you.

Regards,

Roy

I ended up getting my (Script) Action to work (before your post) by following this 3 yr old video:  https://www.youtube.com/watch?v=QJGXkPp2XpU

This video demonstrates how to configure a script type Action Function on the ServiceNow Agent mobile app in Madrid. For more information on the ServiceNow mobile app see: ServiceNow product documentation: ...