Response Template Limitation in Agent Workspace for HR Case Management

Rob Sestito
Mega Sage

Hello SN Comm Team,

 

I am looking to see if we can expand the number of Response Templates to show up when working in the Agent Workspace for HR Case Management. It looks like the limit is set to 10 somehow, and the client would like the limit to be unlimited. So that the HR Rep and check on the response templates and keep scrolling until they find the one they want.

 

I have tried doing some research and found couple of posts here that say to check on system property "com.glide.quickactions.maxresults.templates". (Is there a response template limit on Agent Workspace? ) And if it does not exist, create it as an integer and give it a value.

 

I have done this - but it did not work for me. My first thought was, am I creating this property in the wrong application. So I created it in the following and tested each time: Global, HR Core, HR Workspace, Agent Workspace for HR Case Management, Interaction Management - Service Operations Workspace, Workspace Core, and Workspace App Shell.

 

Nothing has worked for me - therefore, anyone know of something else that can be done for this?

 

If there is a limit being set already to show 10, I feel like I should be able to adjust that setting. Something has to be controlling this, right?? However I am unable to locate this if there is.

 

Any help with this would be great!

Thank you,

-Rob

1 ACCEPTED SOLUTION

So @Rob Sestito  answer is to change the limits from here
cxs_table_config_list.do

View solution in original post

13 REPLIES 13

Musab Rasheed
Tera Sage
Tera Sage

Hello Rob,

As per below HI article, max limit is 9, check this out

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0994577

Please hit like and mark my response as correct if that helps
Regards,
Musab

Hello Musab,

Thanks for replying - however, this article you are referencing seems to be talking specifically towards agents/agent chat/how many agents can be see available/templates for agent chat.

 

I am trying to configure the response templates that can be located from the hr case form, on the agent workspace for hr case management:

RobSestito_1-1670253748809.png

 

Something must be controlling how many templates will be displayed without doing a search for them, right?

My client would like to have the ability to just keep scrolling here until locating the one they want to use for a particular hr service.

 

I did find a script include called "ResponseTemplateSearchHelper", specifically line 7 which is "this.DEFAULT_COUNT = 10".

 

var ResponseTemplateSearchHelper = Class.create();
ResponseTemplateSearchHelper.prototype = {
    initialize: function(request, response) {
		this.request = request;
		this.response = response;
		
		this.DEFAULT_COUNT = 10;
		this.DEFAULT_OFFSET = 0;
    },

	processSearch: function() {
		var inputs = JSON.parse(arguments[0]);

		if (!inputs['tableName'])
			return;
		
		this.table = this.request.formTable;
		var responseTemplate = new sn_templated_snip.ResponseTemplate();
		this.responseTable = inputs['tableName'].toString();
		this.sysId = this.request.formId;
		this.search = this.request.query && this.request.query.freetext ? this.request.query.freetext : '';
		this.count = Number(inputs['count'] ? inputs['count'].toString() : this.DEFAULT_COUNT) + 1;
		this.offset = Number(inputs['offset'] ? inputs['offset'].toString() : this.DEFAULT_OFFSET);
		
		var encodedQuery = inputs['script.encoded_query'];
		var channel = responseTemplate.CHANNEL_FORM;
		if (encodedQuery.includes('channels=')) {
			channel = encodedQuery.replace('channels=', '');
		}
		var opts = {
			channel: channel
		};

		var results = responseTemplate.query(this.table, this.sysId, this.search, this.count, this.offset, true, '', opts);

		this.formatResults(JSON.parse(results));
	},

	formatResults: function(results) {
		if (!results || !results.length)
			return;
		
		var sysIdResultsMap = {};
		
		for (var i = 0; i < results.length; i++) {
			var result = results[i];
			sysIdResultsMap[result.sys_id] = result;
		}

		var gr = new GlideRecordSecure(this.responseTable);
		gr.addQuery('sys_id', 'IN', Object.keys(sysIdResultsMap));
		gr.orderBy('name');
		gr.query();

		while (gr.next()) {
			var response = sysIdResultsMap[gr.getUniqueValue()];

			// Swap template with evaluated response
			gr.setValue('html_script_body', response.evaluated_response.evaluated_body);

			var srdc = new SNC.SearchResultDisplayConfiguration(gr.getTableName(), this.request.getUiType(), this.request.getFormTable());
			var res = new SNC.SearchResult();
			res['title'] = response.name;
			res['snippet'] = response.evaluated_response.evaluated_body;
			res['id'] = this.responseTable + ':' + response.sys_id;
			res.meta.setDisplayConfiguration(srdc, gr);

			this.response.results.push(res);
		}
	},

    type: 'ResponseTemplateSearchHelper'
};

 

However, when I try adjusting this to see if it could help me (I changed it to a lower number first to see), it broke the response template section. No results were displayed even if I tried searching. I changed it down to 3 to see if I could control the number of results.

 

Any thoughts towards that?

Thank you,

-Rob

 

Dear @Rob Sestito  Did you ever find the solution for this?

Hey @india -

No - we haven't. Each time we try to adjust/modify the script that handles it, the entire functionality just breaks. And no response templates are shown.

 

Thanks

-Rob