
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2020 12:10 AM
Is if possbile to directly pass Requested Item Record to Subflow as a parameter or do I have to extract all the values in the main flow and then pass them to the Subflow parameter?
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2020 12:35 AM
Hi Howza
Service Now Docs states:
Subflows on the Requested Item [sc_req_item] table in the Service Catalog cannot accept variables from parent workflows."
The variables are indeed available in the subworkflow (parent on sc_req_item, sub on sc_req_item). They are available in the workflow.variables object.
To find them, use the following log statement in the subworkflow:
gs.log(JSON.stringify(workflow.variables), 'workflow.variables');
The variables are then available by using the toString() method on the variable attributes, e.g.workflow.variables.myvariable.toString(). If your variable is a reference field, it will have the suffix _reference in the variablename. E.g. workflow.variables.hostname_reference.toString() instead of workflow.variables.hostname.toString().
One More Approach:-You could also try to let the subworkflow run on global, then you have input variables.
This is How You Can Pass the Variable:-
- In the editor, open and check out the workflow.
- In the title bar, click the menu icon and select Edit Inputs.
- In the Workflow Inputs window, click New.
- Populate the record with the definition of the variable, including the column name, the label that is displayed to the user, and the type of field.
- Click Submit.
Please Mark Correct and Helpful
Thanks and Regards
Gaurav Shirsat

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2020 05:09 AM
Nice.
Thanks,
Ashutosh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2020 06:39 PM
Thanks all, got it working.