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.

Difference between next() and nextRecord() in servicenow GlideRecord

Roshini
Giga Guru

Hi Team,

Can I know the difference between next() and nextRecord() in ServiceNow GlideRecord.

Roshini_0-1719980388574.png

 

1 ACCEPTED SOLUTION

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

Both next() and nextRecord() serve to iterate through records in a GlideRecord query, with nextRecord() being more optimized for handling large data sets, potentially using less memory. 

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

3 REPLIES 3

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

Both next() and nextRecord() serve to iterate through records in a GlideRecord query, with nextRecord() being more optimized for handling large data sets, potentially using less memory. 

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Thanks for the information and quick reply

Can you please close this question?

 

Or is there follow-up needed?

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn