Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Field Type - Select multiple values

kevwatson
Giga Contributor

When someone is filling in a Catalog Item I want them to have the ability to select multiple options, however the current setup using "Select Box" only allows you to select one of the values.  Please can you tell me how this can be achieved? 

46 REPLIES 46

No permission changes should be required.  All they're doing is reading from the sys_choice table.

Disregard... please see my below post.  (sorry!)

It looks like it is actually using the question_choice table. That's what you used in your instructions and is the only way I was able to get it to work. What do your ACLs look like for that table?

I am only a catalog builder within my org, but they are telling me only 3 roles have read rights to that particular table.

Yeah, you're absolutely correct, it is question_choice and not sys_choice... I'm not sure why I said that.  My apologies.

Here is a screen shot of the ACL that's allowing us to read:

find_real_file.png

 

Here's the actual Script:

var a = {};
var gri = new GlideRecord('item_option_new');
gri.addEncodedQuery('active=true^list_table=question_choice^ORlookup_table=question_choice');
gri.query();
while (gri.next()) {
	var ind = gri.reference_qual.indexOf('question=');
	if (ind >= 0)
		a[gri.reference_qual.substring(ind + 9, ind + 9 + 32)] = gri.name;
}
answer = false;
if (a[current.question.sys_id.toString()])
	answer = true;

Thanks for clarifying it as well. I found an article where someone was doing the same thing and described the ACL differences. https://www.covestic.com/servicenow-tips-making-list-collectors-useful/

Now I have to convince the ServiceNow admins at my business that this is useful without any real negative consequences.

Thanks for the helpful details again!

Great! Thank you!