What is Submit a Request topic flow's 'has_va_support' condition script doing?

rithesh
Kilo Expert

Hi, 

I was checking Submit a Request topic flow, although it's not loading questions anytime. I was wondering what was this condition 'has_va_support' used for? Also, script has 'va_support' to return, I am not sure what it is and couldn't find anything in documentation or contextual search. 

(function execute() {
returnJSON.parse(vaVars.itemJSON).va_support;
})()
find_real_file.png
1 ACCEPTED SOLUTION

That's correct, we cannot access this in the Platform UI. Unfortunately, there's also no documentation on this.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

6 REPLIES 6

Matthew Train
ServiceNow Employee
ServiceNow Employee

There are specific variable types supported in VA.   This is doing a check on the Item to see if it's supported in VA or not.   If it's supported, you can order the item through VA.   If not it sends you to the items URL to complete the transaction.   You can see the supported variables here:

https://docs.servicenow.com/bundle/orlando-it-service-management/page/product/itsm-virtual-agent/ref...

Mark Roethof
Tera Patron
Tera Patron

Hi there,

return JSON.parse(vaVars.itemJSON).va_support;

So you have to dig into where vaVars.itemJSON comes from: Script Action "Set Selected Item".

(function execute() {
    var results = JSON.parse(vaVars.results);
    var index = 0;
    if (parseInt(vaVars.count) > 1)
        index = parseInt(vaInputs.catalog_item);

    vaVars.selected_link = vaVars.portalName + 
        '?id=sc_cat_item&sys_id=' + results[index].sys_id;
    var itemJSON = new sn_sc.CatItem(results[index].sys_id).getItemForVA();
    vaVars.itemJSON = JSON.stringify(itemJSON);
    vaVars.itemName = itemJSON.name;
})()

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

That is exactly what I checked. In Set Selected Item 'itemJSON' variable is stored from below code and I couldn't find any function called 'getItemForVA(); in the system. 

 

var itemJSON = new sn_sc.CatItem(results[index].sys_id).getItemForVA();

 

That's correct, we cannot access this in the Platform UI. Unfortunately, there's also no documentation on this.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn