
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2020 07:22 AM
Hello,
I have an order guide/catalog item that uses a variable set and the variables are cascaded. If someone changes a variable on an associated task I want to capture the change in the activity stream work note. How can I accomplish this?
Thanks,
Joe
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2020 01:04 PM
Can you test this once
var key;
for(key in current.variables){
if(current.variables[key] != previous.variables[key]){
current.work_notes = "Variable changed "+key + "Value Changed to"+current.variables[key];
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2020 01:38 PM
Pranav,
Yes this worked!!
I really appreciate your help with this,
Joe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2022 04:36 AM
Hi Pranav,
We have put in a similar solution and populating changed variables in the comments on our SCATSK. The issue we are facing here is with the variables which has special characters and line spaces in them. Even the variable value does not change, it is still printing that in the comments.
Below is example of the variable value:
TestABCD
/////
$$$$$
&&&&
%%%%%
And below is our script -
(function executeRule(current, previous /*null when async*/ ) {
var str = '';
var key;
for (key in current.variables) {
var v = current.variables[key];
var p = previous.variables[key];
if (current.variables[key] != previous.variables[key] && previous.variables[key] != '') {
str += '\n' + v.getGlideObject().getQuestion().getLabel() + ' : ' + ' changed from ' + p.getDisplayValue() + ' to ' + v.getDisplayValue();
}
}
current.comments = str;
})(current, previous);