how to copy variable field on catalog task form to another field ?

chercm
Mega Sage

how to copy variable field on catalog task form to another field ?

 

i need to copy select from select a peripheral to the asset field , is it to use business rule ?

1 ACCEPTED SOLUTION

Hi @chercm ,

 

Can you please try the below in your business rule:

current.u_asset = current.request_item.variables.item_requested;

 

If you find my response helpful, please consider marking it as the 'Accepted Solution' and giving it a 'Helpful' rating. Your feedback not only supports the community but also encourages me to continue providing valuable assistance.

 

Thanks,

Amitoj Wadhera

 

View solution in original post

10 REPLIES 10

Amitoj Wadhera
Kilo Sage

Hi @chercm ,

 

Create before insert/update BR on sc_task table with the following script:

current.field_name = current.variables.variable_name;

 

If you find my response helpful, please consider marking it as the 'Accepted Solution' and giving it a 'Helpful' rating. Your feedback not only supports the community but also encourages me to continue providing valuable assistance.

 

Thanks,

Amitoj Wadhera

 

@Amitoj Wadhera here the information : 

 

is it some thing like this ? 

 

(function executeRule(current, previous /*null when async*/) {

current.u_asset = current.variables.item_requested;
 
})(current, previous);

 

on the catalog form it is the asset field 

image.pngimage.png

 

Pratima Kalamka
Kilo Sage

Hello @chercm ,

yes,need to create business rule catalog task table and add following script:

 

current.field_name=curretn.varables.variable_name;

refer:https://www.servicenow.com/community/developer-forum/copy-variables-from-catalog-item-into-request-f... 

 

If my answer is helpful please mark it as helpful or correct!!

 

 

 

 

@Pratima Kalamka @Amitoj Wadhera  

 

i tried the following to the before and after in BR does not copy . 

 

image.png