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.

Get particular fields in table by using GlideRecord

Kaka_23
Tera Contributor

 

Hello Community,

I'm curious is there a way to query only specific fields (like two or three) from a table? Since the GlideRecord object retrieves all fields by default, it can impact performance in my scenario. Ideally, I want to fetch only certain fields so that the GlideRecord contains just those fields. While I know we can query records, what if we want to specify which fields to retrieve? Is there a method or approach to accomplish this?

 

Thanks in advance.

 

Regards,

Kaka

1 REPLY 1

Eshwar Reddy
Kilo Sage

Hi @Kaka_23 

I recommend using the GlideQuery API, as it allows you to specify only the fields you need, making it the best option for performance optimization


LINK


Thanks 
Esh