The CreatorCon Call for Content is officially open! Get started here.

Use case for getRefRecord

vidishaagarwal5
Tera Contributor

HI Team,
I am unable to understand 

getRefRecord do we have any doc ??

3 ACCEPTED SOLUTIONS

Ravi Gaurav
Giga Sage
Giga Sage

Hi @vidishaagarwal5 

In the world of ServiceNow development, there are several methods that often go unnoticed, despite their tremendous potential. One such method that deserves more attention is the "getRefRecord" method.

The "getRefRecord" method proves to be extremely useful when you need to retrieve a referenced GlideRecord object and perform updates on it. This method simplifies working with related records, making it easier to interact with referenced data directly.

 

Example: Updating Related Problem Work Notes for a Priority 1 Incident

 

Let’s consider a scenario where you want to retrieve a Priority 1 incident and update its associated problem record with a note. Here’s how you can achieve that using the "getRefRecord" method:

RaviGaurav_0-1760075137251.png

 

--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

ï”— YouTube: https://www.youtube.com/@learnservicenowwithravi
ï”— LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

View solution in original post

Ravi Gaurav
Giga Sage
Giga Sage

Hi @vidishaagarwal5 

 

Look for the below KB article it will help you!!

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0745222

--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

ï”— YouTube: https://www.youtube.com/@learnservicenowwithravi
ï”— LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

View solution in original post

Ravi Gaurav
Giga Sage
Giga Sage

Look for this Blog :

https://developer.servicenow.com/blog.do?p=/post/creatortoolbox-getrefrecord/

--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

ï”— YouTube: https://www.youtube.com/@learnservicenowwithravi
ï”— LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

View solution in original post

4 REPLIES 4

Ravi Gaurav
Giga Sage
Giga Sage

Hi @vidishaagarwal5 

In the world of ServiceNow development, there are several methods that often go unnoticed, despite their tremendous potential. One such method that deserves more attention is the "getRefRecord" method.

The "getRefRecord" method proves to be extremely useful when you need to retrieve a referenced GlideRecord object and perform updates on it. This method simplifies working with related records, making it easier to interact with referenced data directly.

 

Example: Updating Related Problem Work Notes for a Priority 1 Incident

 

Let’s consider a scenario where you want to retrieve a Priority 1 incident and update its associated problem record with a note. Here’s how you can achieve that using the "getRefRecord" method:

RaviGaurav_0-1760075137251.png

 

--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

ï”— YouTube: https://www.youtube.com/@learnservicenowwithravi
ï”— LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

Ravi Gaurav
Giga Sage
Giga Sage

Hi @vidishaagarwal5 

 

Look for the below KB article it will help you!!

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0745222

--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

ï”— YouTube: https://www.youtube.com/@learnservicenowwithravi
ï”— LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

Ravi Gaurav
Giga Sage
Giga Sage

Look for this Blog :

https://developer.servicenow.com/blog.do?p=/post/creatortoolbox-getrefrecord/

--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

ï”— YouTube: https://www.youtube.com/@learnservicenowwithravi
ï”— LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

vidishaagarwal5
Tera Contributor

Thanks @Ravi Gaurav  for Quick Help !!