Card response:Is it possible to only display the content of the field without the name of the field?

billy7
Tera Expert

I am trying to display the content of a field from a table using card response bot but I don't want it to display all the info(names of fields/table/etc). I just want the bot to display the content of the field I'm selecting.

instead of this: 

 

billy7_0-1673966591590.png

 

I would like to have this:

 

billy7_1-1673966812894.png

 

Is that possible using the card bot response?

 

reason behind my madness: MS teams integration doesn't parse html correctly when using script bot response but the card bot response does work. 

 

thanks in advance

 

1 REPLY 1

Muralidharan BS
Mega Sage
Mega Sage

Yes the card component is just an HTML, so you can script it can replace the label. try this below in a script output, 

 

var grIncident = new GlideRecord('incident');
grIncident.addEncodedQuery("caller_id=javascript:gs.getUserID()^active=true^universal_requestISEMPTY");
grIncident.query();
if (grIncident.next()) {

    var title = {url : 'www.google.com', label : 'hi there'};
    var fields = ['number','opened_at'];
    var fieldToRender = new global.VaRecordCardRenderer().createFields(fields, grIncident);
    var s = new global.VaRecordCardRenderer().renderCard(title, fieldToRender);
}
s = s.replace(/Number|Opened/gi, function(){
    return '';
});
return s;

Output with label and without label 

MuralidharanBS_0-1674989463156.png