how to get a variable on request item to populate on the catalog item short description

humblecommitted
Kilo Guru

Hello Community,

I am trying to get a variable called "ritm_short_description" on the catalog item to populate the "short_description" field on the request item.

Here is the catalog item:

find_real_file.png

Here is the variable on the catalog item:

find_real_file.png

Here is how I would like it to be displayed as after the catalog item has been submitted and is now a request item:

find_real_file.png

find_real_file.png

I have been trying workflows and business rules and i am not sure what i am doing wrong.

find_real_file.png

find_real_file.png

Please help!

Thanks in advanced.

1 ACCEPTED SOLUTION

Did you try this in the workflow in the run script activity. This run script activity should be your first activity in the workflow. Or you could also write a before business rule on the sc_req_item table



Run script activity:


current.short_description=current.cat_item.short_description+' '+current.variables.ritm_short_description;



Business rule:


When: before insert


Conditions: Item is <select the catalog item>


Script:


current.short_description=current.cat_item.short_description+' '+current.variables.ritm_short_description;


View solution in original post

13 REPLIES 13

raprohaska
Kilo Guru

If i'm understanding correctly, you have a variable on the catalog item and you have the target record's short description.



If that is true, if you rename the variable to "short_description" then naming convention will auto set the value on the target record.



If you cannot change the variable name, then in the catalog item script you can set current.short_description = producer.ritm_short_description.



Maybe I've simplified your issue too greatly though.


Harry Campbell2
Mega Guru

Give this a try:



current.short_description =   current.variables.ritm_short_description;


hello harry,



is this script on the business rule or the workflow script?


GregJWillis
ServiceNow Employee
ServiceNow Employee

Your BR needs the "current.update()' line if you are doing this as an 'after' update rule.   That should do it.