- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-24-2022 08:57 PM
Hi,
I need to retrieve records from a custom table. It may be single record or multiple records. Can i retrieve it using gliderecord? And I need to retrieve some of the column value of each record. How can we achieve this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-24-2022 09:36 PM
Hello
yes if you want to get any record from any OOB or custom table you need to use glide record .
Here is one example which glides incident table and gets a field or column value called "priority"
var gr= new GlideRecord('incident'); // glide your table
gr.addQuery('category','hardware'); // add your query and pick up records
gr.setLimit(1); // limit your records "Note:" remove this if multiple records
gr.query(); // process the query
if(gr.next()) / check if record exists with the above query "Note": give while if multiple records
{
var pt = gr.priority; // get the column name
}
Please refer to this below link of service now docs which gives you an idea about glide record and its syntax
Please mark my answer correct if it helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-24-2022 09:36 PM
Hello
yes if you want to get any record from any OOB or custom table you need to use glide record .
Here is one example which glides incident table and gets a field or column value called "priority"
var gr= new GlideRecord('incident'); // glide your table
gr.addQuery('category','hardware'); // add your query and pick up records
gr.setLimit(1); // limit your records "Note:" remove this if multiple records
gr.query(); // process the query
if(gr.next()) / check if record exists with the above query "Note": give while if multiple records
{
var pt = gr.priority; // get the column name
}
Please refer to this below link of service now docs which gives you an idea about glide record and its syntax
Please mark my answer correct if it helps you