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

Update as:

desc();

function desc() {


if (current.cat_item == 'sys id of catalog item') { 

current.description = current.variables.variablename1.toString();


}
else if (current.cat_item == 'another sys id'){

current.description = current.variables.variablename2.toString();


}

current.update();
}

Hi,

Follow point from Aman and no need for answer variable

Also there is no need of current.update() if you are using this in run script of your workflow of catalog item

Regards
Ankur

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

Priti18
Tera Expert

ankur, aman i tried above steps not working in my case i tried by using catalog sys id as well as catalog name

can you share the screenshot of your workflow once!!

and by the time add logs and check if possible.

Hi,

If you are using that script in workflow run script of your catalog item then it would work provided you give correct sys_id or correct catalog item name

Regards
Ankur

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