Virtual Agent Card Output Not Displaying Reference Fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2018 09:22 AM
When using the Bot Response type "card" in the virtual agent designer if you select a field to display and that field happens to be a reference field when the card is rendered the reference fields display as empty even if they are filled out in the record.
Is there any way to get the standard card response to display reference fields, or do we just have to create a script output like they did in the "Open IT Ticket" ITSM topic if we want to display reference fields?
Edit: I have not gotten reference fields to display properly using card output or script output.
Script output code:
(function execute() {
var item = new GlideRecord('sc_req_item');
item.addQuery('request', vaVars.created_req_id);
item.query();
if (item.next()) {
var title = {
url: gs.getProperty('glide.servlet.uri') + '/',
label: item.number
};
var fieldList = ['short_description', 'cmdb_ci', 'business_service', 'service_offering', 'assignment_group'];
var cardRenderer = new global.VaRecordCardRenderer(true);
var fields = cardRenderer.createFields(fieldList, item);
var html = cardRenderer.renderCard(title, fields);
return html;
}
})();
Card Configuration:
Yet this is what happens when the topic is run, the REQ and RITM are created and do have all the fields selected populated in the table record but they just will not display in the bot response. (First response is the Script Output, second is the Card Response)
- Labels:
-
Virtual Agent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2019 09:54 AM
Not an answer to your question, but where did you find the properties and methods for the card bot response?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2019 09:45 AM
Hi There,
Do you perhaps have a bit more info on how your logic looks like? I just did a very small test, works fine. With both a Bot Response Script Output to generate the card (with the code you posted) and a Bot Response Card. The only difference in the script is I used a vaInputs instead of a vaVars, but I don't reckon this would be the difference.
Kind regards,
Mark
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2020 02:11 AM
Hi Mark,
i have same issue.when iam giving reference fields for selected table its not populating.
below is my script: