Display catalog variables on task form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2014 03:43 AM
There are a lot of questions regarding workflow and variables but none that seem to answer my question.
I am using a workflow to create a task from a Requested Item. This is a facilities task. I am trying to pass the variables completed on the form onto the Facilities task but I cannot seem to get this to work. I don't want to use a record producer.
Has anyone got any suggestions please?
- Labels:
-
Service Catalog
-
Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2014 06:08 AM
You can use an Order Guide to Order Your original items.
I was suggesting creating a Record Producer to Create your Facilities task (it would NOT be seen by the user). In your WF you would use the script that spawns the Record Producer. The script is in this link: Order a Service Catalog Item from a Script - ServiceNow Wiki. HOWEVER, once I looked at this script; I don't think it will work with a Record Producer. IT uses the 'cart' which Record Producers do NOT.
I would move back to paul_erics solution of writing your variables to the Description field on the Facilities task.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2014 05:42 AM
Thanks for this. I will give it a go.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2014 06:12 AM
there is a script in the mail templates that puts all of the variables on the email.. it would seem like you could adapt that script to work in a workflow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2014 02:55 AM
Ah yes - I have used the script for my emails. I will try and adapt to workflow. Many thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2014 03:39 PM
The workflow should have access to the variables from the form. Make a run script event and log out the values:
Run Script:
var members = current.variable_pool,
collector;
for (h in members) {
var abc = members[h];
if (abc != "") {
collector += "\n" + abc + "\n";
}
}
gs.log(collector);
Your logs should show the variable values listed in no particular order. If you can see the values that means the workflow has
access to them. From there you can use a run script to create the record on the facilities table:
Run Script:
var fac = new GlideRecord('facilities_table_name');
fac.initialize();
fac.<facilities_variable> = current.variable_pool.<form_variable>;
//etc...
fac.insert();