Use PDIs? Take our 5-minute survey to help shape the PDI roadmap.

GetReference

SRIRAMSANKAR007
Tera Contributor

What is the purpose of getReference(). On my understand it's an API used in client side, to fetch real time data of a referenced record. I need more explanation and real time examples when to use this. And give some two to three examples with code if possible.

1 REPLY 1

Rafael Batistot
Kilo Patron

Hi @SRIRAMSANKAR007 

 

getReference() is used in Client Scripts to retrieve the full record referenced by a reference field, so you can access its other fields.

 

https://www.servicenow.com/community/developer-forum/quot-how-does-getreference-function-work-in-ser...

 

https://ikconsulting.com/post/understanding-the-getreference-method-in-servicenow-usage-and-best-pra...

 

 

If this response was helpful, please mark it as Helpful and, if applicable, as Correct.
This helps other users find accurate and useful information more easily