Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Regarding Glide Record method

khuranahima
Tera Contributor

Please clear a doubt.

I tried to insert a record in a table through initialize() method(Glide Record) , using Background Script.

The record was successfully inserted , but when I inserted it without using initialize() method, it was still created.

If we can create a record without initialize() method, then why do we use it?

10 REPLIES 10

@khuranahima 

Thank you for marking my response as helpful.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Insightful! Thanks.

Nikhil Bajaj9
Tera Sage

Hi @khuranahima ,

 

Initialize() creates an empty record that allows you to populate the values.  If you are not using Initialize(), it may still create a record but there is a possibility to have any previous record value or possibility of values overwritting etc. Creating a blank record and then inserting values will make sure that no previous value or overwritting is happening. 

 

Hope i was able to clear your doubt. If yes, please mark my answer as - Solution accepted.

 

Regards,

Nikhil Bajaj

Please appreciate my efforts, help and support extended to you by clicking on – “Accept as Solution”; button under my answer. It will motivate me to help others as well.
Regards,
Nikhil Bajaj

ServiceNow Rising Star-2025

Thanks a lot!