Where are Catalog Item Variables values stored, and How do I move them to the RITM_Descirption via Workflow?

psenkow1
Giga Contributor

I have a catalog item that has several variables associated with it.  I thought the catalog item variables were stored in some table extended from sc_cat_item, but I have been unable to find it.

From within my workflow, in the RITM (request item) I want to (either or both):

1.  Set the short_description to one of the variables in the catalog item, or contatenate 2 of the variables.

2.  Set the description to all of the variables.  

We will ultimately want to display this in the Homepage, which is why I need it to be in the Short Description or Description, rather than in the "Variables" list on the RITM form.

I am afraid I have stepped way deeper than my JavaScript coding abilities!  

Has anyone else done this?  

Can anyone tell me what I need to do?  

I really appreciate the help!

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Patricia,



You can copy the variable value to the RITM field "short_description" as


current.short_description = current.variables.PASS VARIABLE NAME HERE;


View solution in original post

8 REPLIES 8

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Patricia,



You can copy the variable value to the RITM field "short_description" as


current.short_description = current.variables.PASS VARIABLE NAME HERE;


Pradeep, thank you for the quick answer.   However, I tried this:



current.short_description = "From Run Script" + current.short_description + " - " + current.variables.variable_one;



The current short description was:   This is a Test.   When I ran the above statement, the short description was changed to:



From Run Script This is a Test - undefined



It should have said:   From Run Script This is a Test - first variable.



Can you tell me what I did wrong?


Hi Patricia,



Did you used variable set instead   of variables?


If you have used a variable from variable set , then kindly use current.variable_pool.variable_one; in your line.



Also i hope the value you   are passing into the variable on the form is "first variable"?


Raghu Loganatha
Kilo Guru

Patricia,



You can access the variable data by dot walking. In your case you can use the following as example



If you are trying to create a task by workflow try this:



task.short_Description = current.variable_pool.<Field_name>   // Add your field name


task.description = current.variable_pool.<field_name> // Field name which you want to add in description


task.description += current.variable_pool.<field_namne> // You have add += here because you want to add on top of above line