
- 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-14-2020 10:36 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2020 06:48 AM
Hi Howaza,
You need to create input variables in your subflows that you want to flow from your parent flow. While calling subflow from Flow it will ask you to specify the subflow name and the input variables that is required by subflows. You can pass requested item only and extract all the variables in subflow.
Please go through this link to step by step process of passing out of flows as input to subflows.
Please mark this accepted and helpful if your question has been answered. Thanks!
Muhammad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2020 06:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2020 08:00 AM
Hi,
if you are using normal workflow and Subflow activity, you can store current RITM object in workflow_gscratchpad object and pass it to the Subflow activity
Mark ✅ Correct if my response solves your issue and also mark 👍 Helpful if you find my answer helps you based on the impact.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2020 04:47 AM
Thank you all for prompt replies. I'm trying out the solution you've provided. I had to write over 100 knowledge base article for our system. Will get back.