how to pass values to json object

Priti18
Tera Expert

how can I pass the incident category value dynamically in key value format

 

var inccategory = current.category.getDisplayValue();

 var result = "{'category':inccategory} // this gives me error but if I print logs then I am able to see correct value

1 ACCEPTED SOLUTION

Laszlo Balla
ServiceNow Employee
ServiceNow Employee

Remove the quotes around the curly braces:

var result = {"category":inccategory};

View solution in original post

10 REPLIES 10

Awesome it worked!!!

can you please explain as well so for future any one can take reference from this