- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2021 12:02 AM
if there are multiple catalog items with same wf but every time description field is getting changed so in run script activity how can we set it dynamically
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2021 02:55 AM
Hi,
As I mentioned please don't use current.update()
Now are you using correct sys_id and correct variable name there i.e. variablename1
Did you check that variable value is empty or not
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2021 02:42 AM
in logs i can see the correct sys id when i printed this current.cat_item
but inside if its showing empty value // current.description = current.variables.variablename1.toString();
please check below code
desc();
function desc() {
var sysid= current.cat_item;
if (sysid == '789456') {
current.description = current.variables.variablename1.toString(); //this coming empty
}
if (sysid == '123456') {
current.description = current.variables.variablename2.toString();
}
current.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2021 02:55 AM
Hi,
As I mentioned please don't use current.update()
Now are you using correct sys_id and correct variable name there i.e. variablename1
Did you check that variable value is empty or not
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2021 03:22 AM
yes its because i used current.update and also variable name was not correct.
thanks ankur &aman