addquery Glide Record with a list

arb
Tera Contributor

I'm trying to run a query on the incident_sla view.

What I'm trying to do is return all regions that match a particular value i.e Southwest.

The problem is that DOT walking seems to fail me now,   where it succeeded before on reference fields that point to a string   it fails when it points to a string that is type LIST

The issue seems that my nc_u_region_ids.u_region_name actually points to a data type of LIST

column label   column name     type       reference

Region IDs

u_region_ids

List

Region IDs

Is there any way to effectively query on a List?

Below is what I'm trying to accomplish in this pseudo method

  1. gr.addQuery("inc_u_region_ids.getDisplayValue()", "Southwest");

    Or
  2. gr.addQuery("inc_u_region_ids.u_region_name", "Southwest");
5 REPLIES 5

sachin_namjoshi
Kilo Patron

List values are stored in array.


You will have to use split() function to split values and then use addQuery.



Please use below as example



http://wiki.servicenow.com/index.php?title=Referencing_a_Glide_List_from_a_Script#gsc.tab=0



Regards,


Sachin


Do you have an example of setting up a query to a column of type 'List' in order to find a match (i.e. setting up the addQuery statement to work with a list type)?   We are not trying to return the results, rather I am querying the column to try and find a match (in this case, the match would be "Southwest").


Hi Adam



Would this KB Article on HI be of any help? ServiceNow KB: Interacting with a Glide List field (KB0596181)



Kind regards


Shahid


The ServiceNow Wiki content is no longer supported. Updated information about this topic is located here: Referencing a Glide List from a Script




Visit http://docs.servicenow.com for the latest product documentation