- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2019 11:24 AM
Hello there ,
We have a catalog item with 2 Variables Variable1 will be displayed on the form and Variable 2 is hidden but available on catalog task when the request is raised the variable1 value entered by the user should be populate in the variable 2 on catalog task ,
I tried Below scenarios : used the On submit client script (its populating the values on catalog task but when ever i save the task all the values are clearing /deleting )
is there a way i can copy values form Variable A to Variable B on catalog Task ?
I also tried on catalog task advance script
task.variable1= current.variable2
and
task.current.variable1= current.variable2
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2019 04:37 AM
kam,
Since you're using a Client script, your values aren't saved to the DB when the page reloads. So, when you add notes to the record, the previous values from the Client script disappear. You'll need to run a Server-side script if you want the values to persist.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2019 11:47 AM
tried that but no luck
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2019 11:50 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2019 12:04 PM
When you put code like this in a background script, are you getting any output?
var reqItem = new GlideRecord('sc_req_item');
reqItem.get('64c14e82db058810744f4b8b0b9619ca');
reqItem.query();
if(reqItem.next()) {
gs.info(reqItem.variables.variable_1);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2019 12:34 PM
its giving the value i entered

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2019 12:39 PM
Now, if you're trying to get that value into a field on you task record, you should be able to assign it in the script field of your Catalog Task workflow activity. Try first assigning the value to the short_description on your task:
task.short_description = current.variables.variable_1.getDisplayValue();