Servicenow get gliderecord from reference field. Dotwalking Just like GlideRecord, GlideQuery .

Servicenow get gliderecord from reference field Model and model category remains blank. getValue () has saved my life more times than I care to admit. Therefore, a request is made from the client browser to obtain the record data. It is recommended that new ServiceNow provides client-side JavaScript APIs allowing all of you to control aspects of how ServiceNow is displayed and functions within the web browser. bs. Every record in every table is a sys_id, and ServiceNow Admins and Developers need to use sys_id's in their every day jobs managing the ServiceNow Platform. I can get other fields from the record. Caller is reference field Caller - Reference field, referenced from sys_user table having sys_id of user selected in the field. It dramatically simplifies filtering and reading in fields referenced by the current table instead of executing another GlideQuery. Technically we could say that for a record the short_description says "number" and then if we have previously queried that record (gr) we Mar 10, 2025 · Hello, i'm knowledge manager and need to prevent external users from accessing a Knowledge base. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. If you’ve ever found yourself writing multiple scripts just to update or Getting accurate field values from GlideRecord objects is crucial when scripting in ServiceNow. In the Business Rule, would it make more sense to dotwalk each of these like this: current. A GlideRecord is an object that contains records from a single table. . var a2 = new GlideRecord ('ast_contract'); a2. I want to set field 1 to part of table B's field 2. The type of object is GlideElement, and the GlideElement API is available. Firstly that the related records are updated first and then the actual record afterwards. It is recommended that new Mar 8, 2024 · ``` In this approach, the script include retrieves the users who are members of the 'Service Desk' group, and JavaScript filters the reference field options based on this list when the page loads. javascript: var knowledge = ne A GlideRecord contains both records and fields. Feb 28, 2025 · The addExtraField function in ServiceNow GlideRecord class is used to include additional fields in the query result that are not normally retrieved. 1. For information about GlideRecordSecure, which is a class inherited from GlideRecord that performs the same functions as GlideRecord, and also enforces ACLs, see the . hasRole ('<role>') to see if the current user should be required to do it. value1; current. addQuery('agent_extended_info. A more fundamental issue is that for queries that aggregate data (in this case count date) one should use class GlideAggregate, not GlideRecord. getDisplayValue ()) if the field type is dropdown or reference, the drop-down fields can have a label as well as a value, It's the value that gets stored in the actual database. Use standard GlideRecord syntax in its place. Trust me your instance and user base will thank you for not doing that! Dec 11, 2019 · Hi , I am creating a UI action to redirect to a record that is queried from another table. var ts = GlideRecord('sys_atf_test_suite'); >>>> gliderecord on suite table to find a record which has sys_id of catalog item Oct 9, 2017 · I am needing to reference the 'short_description' field from the kb_knowledge table. I have been able to filter on the business service with this query from a workflow (which also filters on a specified user): Nov 24, 2023 · Am trying to update a field inside the current records reference field. This will translate sys_id’s into human readable information. caller_id. This design helps maintain relationships I am all about setters and getters but my problem is that GlideRecord. GlideRecord is a ServiceNow API that allows you to interact directly with database tables—querying, inserting, updating, and deleting records with ease. Oct 27, 2022 · Hi, I'm trying to fetch data from another dev instance. Next, we'll need to add the grouping field, discovery_source, to the addAggregate and getAggregate statements. ServiceNow provides client-side JavaScript APIs allowing all of you to control aspects of how ServiceNow is displayed and functions within the web browser. Makes your code significantly cleaner when handling reference fields. update (), the The GlideRecord class is the way to interact with the ServiceNow database from a script. It is recommended that new Feb 8, 2023 · Hi Sharadha, In field mapping script you cannot use current to get the value from the source field. Table1 name parent (reference field ->Table1. u_reference. e. name or the Country of a Location of an Asset associated to an incident: gr Dec 9, 2022 · In ServiceNow, g_form. get ('number', gr. getDisplayValue ('parent'), number); gr. The field where the value is being stored, is it a string field or a reference field? Try the below script, it might work - var oc = gs. There are a few things to take note of when using these methods. Could someone please help on this. May 1, 2024 · Use Case -GlideRecord's Display Value Use Case - GlideElement class (gr. setValue ()` is a GlideRecord method used to set values for fields in a GlideRecord object. Technically when you have a GlideRecord object, you're working with objects when you reference any of the values. See the GlideRecord API reference for a complete list of methods. Dotwalking is presumed in the Now platform and should be reasonably familiar to most GlideRecord developers. I tried mapping and tried transform map script as well using gliderecord as below- var gr= new GlideRecord ('x_asset'); //x_asset is asset table name Feb 27, 2019 · Scoped GlideRecord - addQuery(String name, Object value) The first parameter is the table field name. getRefRecord (); //Retrieve the GlideRecord for the value populated in the 'caller_id' field May 20, 2021 · ‘getRefRecord’ Query Shortcut (used to get a single GlideRecord referenced in a reference field) The ‘getRefRecord’ method can be used as a shortcut to query a record populated in a reference field on a record. getValue ('field_name') return null for blank columns? Go to solution wfurman Mega Contributor Aug 29, 2025 · Hi team, I want to use GlideRecord() method in function definition field because need to query other table and get specific field value. Jan 22, 2018 · Dot walk up to the display field for the table that field references: Don't know what that might be for your custom table, so I'll illustrate with Incident: var rotisserie_chicken = new GlideRecord ('incident'); Aug 14, 2014 · Generate a GlideRecord Query for a List Have you ever wanted to get a quick GlideRecord Query for a list you’re looking at? I’ve wanted to do that many times. Var gr= new GlideRecord ('sysapproval_group); gr. If you set the value without the displayValue, the ServiceNow instance does a synchronous call to retrieve the display value for the record you specified. Script to use: Mar 15, 2022 · Hello, I am trying to get a GlideAjax query to work based on some reference fields that are on the sys_user table. May 7, 2025 · ServiceNow scripting can sometimes feel complex, especially when dealing with related records and reference fields. value1 = current. The field names are the same as the underlying database column names. parent. I know it will always be 32 for reference type fields, but there is a way to look at backend and find a 'true' max length for these fields. Is it because of same table itself added as reference field? Ex. Eliminates the need for additional database queries. When a user Dec 12, 2017 · The u_application_roles table has a reference field named u_application_access that references Business Service (cmdb_ci_service). query (); . For additional information, refer to GlideRecord - Scoped. Scoped GlideRecord - get (Object name, Feb 8, 2018 · GlideForm - Client Returns the GlideRecord for the field (must be a reference field) you specify in the parameters. Mar 23, 2023 · For example- I have reference field as Asset which is referring to the name field of Asset Table. If a callback function is present, this routine runs asynchronously, and browser (and script) processing will continue normally until the server returns the reference value, at which time the callback function will be invoked. This is used widely in business rule scripts but incorrect usage of this can cause some major issues. The getRefRecord () method on the other hand, returns a GlideRecord object that's pre-populated with the record, the sys_id for which is the value of the field. value2 = current. It is recommended that new Reference fields would handle this for you. Learn to fetch GlideRecord objects seamlessly, avoid common pitfalls, and enhance user experience with asynchronous callbacks. This extra round trip to the server can impact performance. getValue('name')'. And when you are using dot walking you have to use getDisplayValue () and getValue (). If it's based on the assignment group, then you need to use a GlideRecord query to get the value of the field on the group record. sys_cl Mar 13, 2020 · Solved: Hi , How to know the value of Reference Field values in a Record ? ( Value) var arr_fields= []; var fields = new ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. getUserID (); // will take the sys_id of current logged in user var grUser = new GlideRecord ('sys_user ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. Reference fields in ServiceNow link one record to another, such as an incident’s caller referencing a user Mar 10, 2023 · Hi all, I am trying to run a query on the Agent Client Collectors table and then get the display value of the location field. You'd do the following: gr. Hi @Prerna_T location is a reference field in user table, so you need to dot walk location. toString(); May 20, 2021 · ‘getRefRecord’ Query Shortcut (used to get a single GlideRecord referenced in a reference field) The ‘getRefRecord’ method can be used as a shortcut to query a record populated in a reference field on a record. name to get Name of the location. Jul 31, 2024 · Returns a GlideRecord object for a given reference element. getDisplayValue () can only be used on reference fields in ServiceNow. If you pop the sys_ids in to an array, you get a list of all of the same values (of the last record. number ), or by using the getElement method of a GlideRecord object. With reference fields (essentially foreign keys), you can use dot-walking to query through a reference field to query against fields on the referenced record. While it's not perfect, it's often the better option to ensure you have the value (especially in loops. My question is how to fetch display name model and model category (both are reference field) in asset table. Jun 26, 2020 · I know reference field holds the sys_id of record. The GlideRecord query to Feb 22, 2023 · How to get value from reference field on service catalog item form? Go to solution Jarkko Tera Expert The GlideRecord API is the primary means of interfacing with the database on the server-side code. It is recommended that new A GlideRecord contains both records and fields. Thank you, Oct 19, 2020 · When using setValue () on a reference field, be sure to include the reference field displayValue as the third parameter. Jan 13, 2023 · This method of walking from a field to another field in the referenced table is a functionality exclusive to field of type Reference. Example is below: / Nov 12, 2022 · I am glide recording to sysapproval group table and trying to match the ritm number with the approval group table parent (reference field to ritm) I'm unable to get the value of parent of approval group table. print(elements); } output: you will get field values of that particular record in array Another script with all details: You can refer this to use for both global application and scoped applications var incident = new GlideRecord("incident"); incident. setValue ()` in ServiceNow: ### Syntax: gr. Mar 20, 2024 · I have a custom reference field where i want to return all the group members from one group (to be able to select one). An undefined or empty company field should return true. However, since JavaScript is a "loosely typed" language, you can reassign a variable of one data-type (such as an Hi, I'am using GlideRecord. field_name. Jul 29, 2022 · It depends on the type of field also if its a reference we need to query with sys_id as reference accepts only sys_ids , if its string type you can query with string . Jun 9, 2023 · Let's next do this. It for sure has a value. It is recommended that new Mar 12, 2021 · Dotwalking and Flags Similar to GlideRecord, GlideQuery supports dotwalking, both when using select and where. Please note: The APIs below are intended for scoped applications and may behave differently in the global scope. Does Service Now allow querying referenced fields through the GlideRecord? And if so, how? I have an application with a local user table for preferences specific to the application. There are certainly tons of articles and posts covering this topic The GlideRecord class is the way to interact with the ServiceNow database from a script. External users have a company so I'm testing the content of company field in sys_user table but it does not work (works in System Def script background though). u_username; Here's how it would look, you can fill in the field names for the below dot walking structure: [staffduty GlideRecord object]. var gr Oct 24, 2025 · GlideRecord provides access to fields via "Dot-walking", so when you query an incident you can access any field like this: gr. getRefRecord () returns a GlideRecord object for a given reference element. getValue () ALWAYS returns a string. [reference field of staff table]. Mar 3, 2022 · Hello guys, I have a list type field in the department table that points to the user table. So to get the value of the sys_id of the user on the User [sys_user] table from the Staff duty table. Can anyone show me how Nov 19, 2023 · Hi @Anshul Duvey , `gr. to keep it tidy and avoid writing multiple glide records I'd like to grab the table name from a reference field and then use it to point the glide record to the correct table. caller_id it will return me sys_id of user. Dec 27, 2024 · @Hafila Hatta did you check the subflow context the input was passed correctly? Seems the input type in your subflow is GlideRecord reference and you are passing sysId to that subflow Do this 1) change the input type to string and pass the sysId 2) then set this in catalog task Assignment group field If my response helped please mark it correct and close the thread so that it benefits future Mar 30, 2021 · You can access a GlideElement from a server-side GlideRecord object (for example, by using gr. ) getValue () copies the value rather than using the reference. There is one field called serial number of which client has provided the data in sheet. I know the u_iccb_fisma_id is actually the sys_id. cmdb_ci. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. can anyone let me know how we GlideRecord is used for database operations. sys_id; >>>> sys_id of record in Catalog Item table 2. Jun 20, 2023 · Solved: Hello. When I need to process records in a table I always use addQuery() to filter. Finally, we'll need to change the 'if' to a 'while' loop so that we can iterate through the groupings. For information on a class that performs the same functions as The getReferenceTable () method returns the name of the table being referenced by the given reference element. how can I get All Department head name as approver for choice onChange client If dot-walking through a GlideElement object is necessary, use the toString () method to retrieve values. Use the API to instantiate a GlideRecord object and add query parameters, filters, limits, and ordering. Pls refer this for more ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. u_staff_name. For example: var Mar 8, 2024 · Unable to fetch reference field value from script includes but the value is return in background Karter83 Tera Contributor The GlideRecord API is the primary means of interfacing with the database on the server-side code. Now my query will be like below. Dotwalking Just like GlideRecord, GlideQuery Nov 16, 2010 · An example of this in the ServiceNow client scripting world might be when you load your incident form and you want to have the ‘Caller’ field show that the currently-populated user is a VIP. Thank you! May 6, 2016 · I prefer gr. A GlideRecord contains both records and fields. I have tried with the below script however the result is blank: var svs = new GlideRecord("sn_agent_cmdb_ci_agent"); svs. I have a basic catalog item which has a requested for field and based on that I want to have the company field populate and then expand this out. It's not catching when the field is empty. Currently, the default field is number. I've been working with the glide record, below to call on the short_description field from the table, but not sure it is a valid qualifier. The GlideRecord API is the primary means of interfacing with the database on the server-side code. This list field can store more than one user sys id. While there are multiple ways to achieve this, choosing the best practice ensures your scripts run efficiently and avoid common pitfalls. If needed, IT can contact the leasing company for additional support. Let's first get rid of the addQuery from above so that we can pull back all discovery sources. Busines Service has a reference field named assignment_group that references sys_user_group. Like Inert,update,delete, display, glideAggregate and many more. next () method. The GlideRecord query to Feb 22, 2023 · How to get value from reference field on service catalog item form? Go to solution Jarkko Tera Expert The scoped GlideRecord API is used for database operations. Could you please help me with this? Appreciate your help. short_description instead of gr. [reference ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. company. For calculated fields, this method fetches the referenced record and runs a calculation on a scripted default value. Note: Use of gs. addQuery('parent_contract',current Reference fields in ServiceNow are special fields that link to records on other tables. It's used to filter the choices available in a reference field based on specific criteria. Oct 19, 2020 · When using setValue () on a reference field, be sure to include the reference field displayValue as the third parameter. If I put the an non-existence sys_id to the GlideRecord. addActiveQuery(); incident. Apr 2, 2020 · Solved: Using this is an IF check on a workflow, and not sure where I'm going wrong. The Company field is a reference fiel Feb 24, 2016 · Hi, is there a way to get the label of the reference field from GlideRecord. getValue ('short_description') But it's best practice to save dot-walking for reference fields, like for getting a Caller's Company name: gr. Attributes: edge_encryption_enabled-true,encode_utf8-false The glideRecord just shows null. Oct 28, 2024 · I have a requirement to copy a bunch of fields from a table selected in a reference field to the form with the reference field on submit. If this not the case, do let me know from which table you are retrieving the sys_id and to which table it setting as display field value. Apr 9, 2017 · Coercion and Typing Server-side GlideRecord objects contain an element for each field in the table that the record is in. getValue ('field_name') return null for blank columns? Go to solution wfurman Mega Contributor May 26, 2015 · Why does GlideRecord. Queries made with the client-side GlideRecord are executed on the server. Under the hood, a reference field actually stores the unique sys_id of the related record, even though it displays a friendly name or label to users. In other words, the record referenced in that reference field is returned. I need to check through a gr if any of that sys id is from the current user. This should effectively filter out users who are not members of the 'Service Desk' group from appearing in the reference field. Sometimes it’s because I’m writing a business rule and sometimes I’ve got to run a background script to update some values. i. Thanks in advance. It is doing this for all reference fields. number returns object, So gr. Jan 30, 2020 · GlideRecord is one of, if not the most, powerful tool at your disposal as a developer in ServiceNow and understanding the basics of using and interacting with it is more or less a prerequisite when dealing with advanced requirements. For example, the Caller field on an Incident form is a reference to a user record on the User [sys_user] table. Key Points: It adds extra fields to the result set of a GlideRecord query. get (), result of that function is an new object is created with the non-existence sys_id I put in ? And it get even worst when at the end of that process there is an GlideRecord. setLimit(1); incident. u_refe We would like to show you a description here but the site won’t allow us. query(); ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. Nov 13, 2018 · Create a Business Rule to Get a Contact for Printer Incidents The scenario: Your company leases printers, but is expected to support the printers. Scoped GlideRecord - get(Object name, Object value)The first parameter is the Name of the instantiated GlideRecord column to search for the specified value parameter. Aug 7, 2022 · Solved: name & approver Variable are Reference field from sys_user. if I do current. var caller = current. Sep 7, 2018 · How do you get the sys_id of a reference field via server script? I tried the following, but I am getting the displayed name instead of the sys_id. var itemID = current. For example, you might need the current caller's manager sys_id to set another reference field. So if I want to get the value of true/false field and then use that value in an expression for example I cannot I want to be able to use the "falsey" and "truthy" principles of javascript. ) As a general Mar 13, 2022 · If you are trying to fetch display value or value of a field on the GlideRecord then you have to pass field as parameter to getDisplayValue () or getValue () method. name) John Sam John Mike John So, if I want to know the parent of mike, I suppose to use Table1. Jun 3, 2024 · The 'getRefRecord' method serves as a shortcut to query a record populated in a reference field on a record. query () to modify the data selection. At the moment it points to sys_user_grmember and it just returns the group name multiple times. Jan 3, 2020 · I've tried using 'get' and have made numerous small changes, but when an incident is created any reference fields I try to populate remain empty. Mar 30, 2025 · Solved: With GlideRecord, there's a notation that you can use to query a field of an extended table - ref_ (extended_table_name). A GlideRecord contains both records (rows) and fields (columns). I copied this from the XML: <u_location0 display_value="myValue">67dcfec913829e40f87cb027d144b0ca</u_location0> What's the deal? Nov 29, 2023 · If expected field is on a child table, make sure the reference field points to the child table and not the parent table. addQuery (gs. getValue ('sys_id'); gr is a pointer. setValue ('field_name', value); ### Example: // Initialize a GlideRecord object for a May 7, 2025 · ServiceNow scripting can sometimes feel complex, especially when dealing with related records and reference fields. May 6, 2015 · Then you could use a g_user. Am using the below code and able to get the logs, but data is not getting updated inside the reference record. For information on a class that performs the same functions as Jan 3, 2020 · I've tried using 'get' and have made numerous small changes, but when an incident is created any reference fields I try to populate remain empty. For example typeof gr. Nov 9, 2018 · Returns the GlideRecord for a specified field. get will work with objects when you say something like gr. Sep 19, 2023 · Solved: I have a need to return all the values from a reference column. Dec 17, 2023 · Simple Reference Qualifier:- A simple reference qualifier in ServiceNow is often written as an encoded query string or a GlideRecord query. Please note: These APIs are provided to support legacy applications in the global scope. Otherwise, the getRefRecord () returns the GlideRecord object from the parent table which will not have the field that exists on the child table resulting in "undefined" errors. Twist: I'm being fed a bunch of field names through an array, and I need to get the field labels for them. I had a quick question about max length for reference fields. These elements are not primitive values (strings, numbers, booleans), but Objects. Apr 8, 2015 · The field which you are referring on the other table might be a reference field of same table from your getting the sys_id. Reference fields would handle this for you. Mar 12, 2021 · Dotwalking and Flags Similar to GlideRecord, GlideQuery supports dotwalking, both when using select and where. I have been able to filter on the business service with this query from a workflow (which also filters on a specified user): Does Service Now allow querying referenced fields through the GlideRecord? And if so, how? I have an application with a local user table for preferences specific to the application. If you’ve ever found yourself writing multiple scripts just to update or ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. User criteria diag with internal user answers false and i dont understand why. manager. This reference lists available classes and methods along with parameters, descriptions, and examples to make controlling the end user experience easier. The following example shows how to get the string value instead of the entire object: var mgr = current. Useful when retrieving fields not included by default in queries. '"table". If you're using the out-of-box tables in ServiceNow for user (sys_user) and company (core_company), they are linked by a reference field on user (sys_user. Feb 24, 2016 · Hi, is there a way to get the label of the reference field from GlideRecord. Feb 17, 2020 · If the reference field you need the value for is not going to change on the form once loaded, you could also use a Display Business Rule and set g_scratchpad value there. sql()) scripting syntax was discontinued in Geneva. Here's how you can use `gr. getReference() is a method of the client side g_form API that is used to get the display value of a reference field on a form. Oct 26, 2023 · Solved: Hello Experts, I need to create a report based on a scripted filter, based on reference field for one of the tables, I'm using below script- If you're using getReference you will get ALL data for each record you "get" whether you need it or not. Oct 17, 2013 · I am writing a bit of script which depending on the circumstances could reference 2 different tables. If a callback function is not present, this Jan 4, 2023 · Solved: How can I update a Reference Field on a Case, that points to the associated Incident Record? I need to be able to do this from a FD Action, Mar 9, 2022 · I have a field name is Xyz and a reference from another job family table, I don't know to get sys Id for Xyz. The client-side GlideRecord API enables the use of some GlideRecord functionality in client-side scripts, such as client scripts and UI policy scripts. PS: DO NOT use GlideRecord Client Side to get reference field related field values. number). But it is not null. instead of sys_id? Here are some screenshots: Specifications: u_topic field is referenced from another table. So my main question is, whats the correct way to query GlideRecord with a string in order to get a sys_id which is necessary for defining reference fields? Thanks for any advice! Oct 10, 2024 · Hi @mahesh009 , GlideForm - getReference (String fieldName, Function callBack) Returns the GlideRecord for a specified field. . This method allows you to assign or update field values in records before inserting or updating them in the database. Here is my code: var startGR = new GlideRecord ('some_table'); Mar 13, 2022 · Subrahmanyam2 Giga Guru Options 03-13-202208:09 AM Hi Sironi, If you are trying to fetch display value or value of a field on the GlideRecord then you have to pass field as parameter to getDisplayValue () or getValue () method. var gr = new GlideRecord('sys_user'); // I need record from user table. May 26, 2015 · Why does GlideRecord. Jan 22, 2018 · u_iccb_fisma_id is a reference field to the cmdb_ci_service table. Both sys_id's between stances are different so I guess I have to use displayed name. The person who maintains the business relationship May 7, 2025 · Understanding GlideRecord and Reference Fields Before diving into the methods, it’s important to understand what GlideRecord is. Dec 11, 2022 · Learn what sys_id's and reference fields are and how to use the GlideRecord API get () method, to retrieve records in scripts. I'm working on the simplest GlideRecord query for a fix script and I'm not able to get the value of a field using . getDisplayValue Dec 10, 2024 · It returns a GlideRecord object instantly. I tried Jun 6, 2016 · The value of a reference field is the sys_id of the referenced record. The contact details should be written to Description field on an incident for the person assigned the incident to reference. Detail requirements follows; Create a field 1 (<-function field) in table A. Aug 22, 2022 · When you think of reference fields, sys_ids and records referencing records on other tables, make sure to consider using getDisplayValue () in your GlideRecord queries. Instead of writing multiple lines to get reference fields values, you can access them directly, It's changed how I approach reference field handling. I can’t think of a scenario where a non reference field type would ever been associated to Oct 18, 2021 · Hello, I am just wondering, if it is possible to get all possible values / fields from record successfully get from GlideRecord query? Or each field has to be addressed manually? I was thinking about similar output like in Powershell with Select * . It is recommended that new Nov 5, 2024 · Hi, I am new to ServiceNow and trying to navigate my way to build reports. Best practice dictates that you always use the getter and setter functions: getValue () , and setValue () if you want to get the value of the field. How do I leverage getLabel to get the label from an array that is dynamically passed? Feb 20, 2022 · No idea. company). name but its not working. It is recommended that new Feb 27, 2019 · Solved: Scoped GlideRecord - addQuery (String name, Object value) The first parameter is the table field name. as in your script services and assignment group are references you need to use sys_ids to compare Apr 5, 2023 · In this post you will get example code with detailed explanation on GlideRecord. getReference (). Works before calling . If you're using GlideAjax you only get what you need, because you will explicitly return the exact information you need and nothing else. Secondly you need to keep in mind, that if a related record does no exist, one will be created. table A is referenced by table B's The scoped GlideRecord API is used for database operations. Dec 15, 2023 · Master client script efficiency in ServiceNow with our expert guide on using g_form. So my main question is, whats the correct way to query GlideRecord with a string in order to get a sys_id which is necessary for defining reference fields? Thanks for any advice! Mar 30, 2021 · gs. Also using getReference () is a bad practice, you need to use script include and client script using glideAjax call, Mar 10, 2023 · Hi, Actually I can't get the value of a reference field (which refers its table itself )using Glide Record in Script include. A reference field is a field that references another table in the ServiceNow database, and displays the display value of the referenced record. Please guide. You might also want the location of that caller to populate as the ‘Caller’ field changes. get () to get single record and I have found this behavior strange happened during writing logic for my handler. gpah cmmy avlb vaio cvra mugfg ijws wsga dtl dwuitfx fuo enbs jyryhz xsr wxrah