- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2015 10:32 AM
I've created a Catalog Item that has a variable to capture input needed when requesting the item. The workflow I've added to the item has a input variable. How do I pass the value supplied for the variable on the Cat item to the workflow input variable?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2015 10:48 AM
Hi David, if I'm not mistaken the variable and the workflow variable just need to be called the same. Just keep in mind that these names are case-sensitive.
Also, keep in mind when using a workflow for any item (for instance Request item on your case), all the variables on the request item are accessible in the workflow. You can access these by doing:
current.variables.the_name_of_the_variable
Just make sure the table on your workflow property is rightly set on the context of what current should represent. Requested Item on your case.
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2015 10:38 AM
If, for example, I were referring to a variable named "Category" from the catalog item, I would access it like so:
current.variable_pool.Category
Something similar we used:
var reqItem = new GlideRecord('sc_req_item');
reqItem.addQuery('request',current.sys_id);
reqItem.query();
while (reqItem.next()){
reqItem.u_charge_code = reqItem.variable_pool.charge;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2015 10:48 AM
Hi David, if I'm not mistaken the variable and the workflow variable just need to be called the same. Just keep in mind that these names are case-sensitive.
Also, keep in mind when using a workflow for any item (for instance Request item on your case), all the variables on the request item are accessible in the workflow. You can access these by doing:
current.variables.the_name_of_the_variable
Just make sure the table on your workflow property is rightly set on the context of what current should represent. Requested Item on your case.
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2017 02:18 AM
Hi Berny,
I got your point and it is in case of we are using Requested Item table in workflow. Is it possible to get values in the same manner if we are using Incident table in workflow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2017 07:53 AM
HI Mamoj,
In the case of incidents I believe the concept of variables do not exist, so you will only need to access the fields directly. For instance, for changing a short description field you can do something like:
current.short_description = "hello world";
Thanks,
Berny