Virtual agent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2025 09:40 PM
How to pass/map the values to the variables in the ritm record
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2025 09:54 PM - edited ‎02-11-2025 09:59 PM
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
})();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2025 10:02 PM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader