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.

List collect showing "No matches found"

Eric Gilmore
Mega Expert

I have a list collector that points to a table for it's values. If a non ITIL role user tries to use the variable, they get "No matches found". The table only has the default ACL & user it was setup with. What's going on here? Has anyone else run into this?

1 ACCEPTED SOLUTION

Eric Gilmore
Mega Expert

So I did this workaround.

The background is that users without any roles assigned, or NOT associated with roles like ITIL or maybe admin, can't see the reference field values.

So, as a work around I changed the field on my record producer from a reference field to a select box with no values. I then created a script include with a getter function to lookup the entries in the reference table. Next I created a client script on the variable set that uses a GlideAjax script to make a call from the client side to server side to retrieve our data from the reference table.

I filter the returned entries in the script include via an addQuery() function, to return a subset of the possible values in the reference table. Using these returned entries on the client side I do a g_form.addOptions() to load our selectbox with the options we want and their associated sys_ids.

Now since I did a lookup on my reference table, I'm using the actual sys_ids I need to properly set the other form field on the Incident form. Because of this, the values are properly set using the correct sys_ids. No muss, no fuss, no more values not showing up in my drop down.

So what I essentially did was to bypass whatever process is used to authenticate that a user has the proper role to see the values in my reference table. 😮

View solution in original post

8 REPLIES 8

Hi Eric -

Not too random, but definitely a unique entry specific to this purpose. Here's an example:

find_real_file.png

-Stephen

Eric Gilmore
Mega Expert

So I did this workaround.

The background is that users without any roles assigned, or NOT associated with roles like ITIL or maybe admin, can't see the reference field values.

So, as a work around I changed the field on my record producer from a reference field to a select box with no values. I then created a script include with a getter function to lookup the entries in the reference table. Next I created a client script on the variable set that uses a GlideAjax script to make a call from the client side to server side to retrieve our data from the reference table.

I filter the returned entries in the script include via an addQuery() function, to return a subset of the possible values in the reference table. Using these returned entries on the client side I do a g_form.addOptions() to load our selectbox with the options we want and their associated sys_ids.

Now since I did a lookup on my reference table, I'm using the actual sys_ids I need to properly set the other form field on the Incident form. Because of this, the values are properly set using the correct sys_ids. No muss, no fuss, no more values not showing up in my drop down.

So what I essentially did was to bypass whatever process is used to authenticate that a user has the proper role to see the values in my reference table. 😮

Hello, can you provide the script include and the client script you did ?

 

 

 

TAI  🙂

Hello.. I need something similar.. can I know the script include and client script on this?