Virtual agent

HARSHA GOWDA R
Tera Contributor

How to pass/map the values to the variables in the ritm record

HARSHAGOWDAR_0-1739338668172.pngHARSHAGOWDAR_1-1739338698556.png

There is a variables called requested_for,short_description and the values are getting in the variables section but the values are not mapping in the ritm record

2 REPLIES 2

SK5555
Tera Contributor

could you please check the inputs 

vavar.short...    => vaVar
and please check the variable names it should be exact matching 

(function execute() {
var cart = new sn_sc.CartJS();
var item = {
'sysparm_id': 'fd2bf35c1bffd410bab14005bd4bcb69', // Catalog item sys_id
'sysparm_quantity': '1',
'variables': {
// 'Requested For': vaInputs.request_for,
// 'requested_for': vaInputs.request_for,
'requested_for': var.requested_for,
'corporate_id_email_id': vaVars.corporate_id,
'manager': vaVars.manager,
'Short Description': vaVars.short_description
}
};

// Add item to the cart
var cartVals = cart.addToCart(item); // Returns a JSON object with cart status

// Checkout and submit the order
var checkoutVals = cart.checkoutCart(); // Returns JSON with checkout details
})();

Ankur Bawiskar
Tera Patron
Tera Patron

@HARSHA GOWDA R 

are those input variables to virtual agent i.e. you are getting the inputs from user?

if yes then ensure you give the correct input value while setting the variable value

vaInputs.yourVAVariableName

check this and response from Abinaya4

Submit catalog item as conversation in Virtual Agent 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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