Response templates sorting/ordering

Rocking Ravs
Giga Contributor

How to set order of response templates in the dropdown which appears when we click on the button -Responses?

6 REPLIES 6

Justin Lucas
Kilo Sage

Hey Rocking Ravs,

Were you able to find a solution for this? I tried updating the "message_template" UI page and "NoteTemplate" script include but couldn't get the sort order to work.

Thanks,

Justin

Hi Justin,

I found the solution to this and it is working now.

I made the change in script include - NoteTemplateCheck

_getTemplateConfigurationsGrForTable : function(currentTable){
var tableParent = new GlideTableHierarchy(currentTable).getBase();
var table = currentTable;

// add the current table to parentlist
var tableParentList = [];
tableParentList.push(table);

//get all the parents of the current table
while ( tableParent != table) {
tableParentList.push(tableParent);
table = tableParent;
tableParent = new GlideTableHierarchy(table).getBase();
}

//comma separated values of the parent list
var tableAncestors = tableParentList.join();

var noteTempConfigGR = new GlideRecordSecure("sn_templated_snip_note_template");
noteTempConfigGR.addQuery("table","IN",tableAncestors);
noteTempConfigGR.orderBy('name');
noteTempConfigGR.query();


return noteTempConfigGR;
},

 

You can try this.

Thanks!

Ahh, the one place I didn't check. I tested this on my personal instance and it worked perfectly.

Thank you for providing the solution!

Works like a charm!
Thanks!