Scriptable order guide in workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2019 07:07 PM
I need help with scriptable order guide that I've included in my workflow.Below script not working and its showing an error. i have a mandatory choice field on the main order guide form which need to select ADD (parameters.v_FunctionSelect = "efa9c1eadb129300dfafa026ca96192a" +"";) then sub form will appear where i need to fill up other mandatory fields as below.
script as below:-
//Keep in mind:
//*This activity will automatically create a service catalog request.
//*For more info: http://docs.servicenow.com/?context=Running_Order_Guides_Automatically
var parameters = new JSON().decode(current.payload);
parameters.opened_by = current.opened_by+"";
parameters.v_RequestedFor = current.variables.requested_for+ "";
parameters.v_FunctionSelect = "efa9c1eadb129300dfafa026ca96192a" +""; //main order guide form mandatory field, select add
parameters.v_SecurityGroupDomain = "bb370616db82638c1e11f99468961980" +""; //sub form mandatory field
parameters.v_SecurityGroupInfoCorp = "48a9e946db5127c80810f2f9af96194d" +"";//sub form mandatory field
parameters.v_AddMembers = current.variables.requested_for.getDisplayValue() +"";//sub form mandatory field
parameters.v_Reason = current.variables.u_business_justification.getDisplayValue() +"";//sub form mandatory field
answer = new JSON().encode(parameters);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2019 11:29 PM
Hi
Can you first put that opened by in some other variable i.e
var openedBy = current.opened_by+"";
and then
parameters.opened_by = openedBy;
Refer the thread below-
Regards,
Omkar Mone.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-04-2019 11:27 PM
Hi Omkar,
its not working.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-04-2019 11:52 PM
Hi
Are you sure you have opened_by?
try doing toString() once instead of +"";
Regards,
Omkar Mone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2020 03:50 AM
Hi, can anyone have a solution to this error?