- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2016 12:10 AM
So I have some variables that are on my catalog item and are hidden on the form. Now we know that those variables we can get on the request item form and the catalog task form too. I have created a task where I want to give value to those variables. My issue is how to fetch those variables in a workflow(on request item table) so that I can set some conditions based on that.
So basically Here I have a checkbox and a choice field coming from the catalog item. I want to access those values in my workflow
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2016 01:33 AM
Use current.variables.yourvariablename to get or set values to variables.
Thanks,
Mihir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2016 12:57 AM
Hi Sidarth
you could built in a "Run Script" activity with the following code
var getsc = new GlideRecord('sc_task');
getsc.addQuery('request_item',current.sys_id);
getsc.addQuery('request_type', 'Web Puslishing');
getsc.query();
if (getsc.next()) {
getsc.yourcheckboxvariablename = 'true';
getsc.yourchoicevaribalename= 'your choice';
getsc.update();
}
Something like that, you need to modify the variables based on your requirements.
let me know if that helps.
Frank
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2016 01:01 AM
So Can't I do without running a GlideRecord. Since my workflow is also on the request item there should be some way to get those variables. And I was thinking to get those variables in script area of catalog task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2016 01:10 AM
Hi Sidarth,
i guess you are right, you can do this within the advanced script in the Catalog Task.
Similar to the example setting the description:
task.short_description = current.short_description;
task.checkbox = 'true'
Give it a try.
Frank
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2016 01:15 AM
I tried that but it's not working. Giving undefined.