how to set description dynamically?

Priti18
Tera Expert

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

1 ACCEPTED SOLUTION

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

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

12 REPLIES 12

Priti18
Tera Expert

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();
}

 

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

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

yes its because i used current.update and also variable name was not correct.

 

thanks ankur &aman