logo

NJP

Should ServiceNow Admins Learn Javascript (and does ChatGPT influence the answer?)

Import · Mar 16, 2023 · article

All things being equal, ServiceNow admins should learn to code with Javascript. It makes you....
\- A superior troubelshooter

\- A superior automater- A stand-in dev when that team is overloaded

\- A better salary expectation.

The more code you understand, the better you do at all of this. **BUT**

ChatGPT has changed hte game a bit. What if I knew very little code but and you're tasked with finding blank assignment group incidents and reassigning them according to caller company? Lets ask ChatGPT

And what did ChatGPT return?

Which is awesome because not only did it comment its own code, but it also explained it. If I knew nothing much about ServiceNow scripting I now know about GlideRecord, while loops and if statements.

Now about this time a skeptic would say "Yeah but everyone should use updateMultiple() instead of update()"

And since ChatGPT remembers our conversations, why don't we ask it to adjust the script

To which ChatGPT responds....

Even if I knew javascript, its almost faster to have ChatGPT to do the typing for you.And about now a skeptic might think: Yeah but aren't you afraid you're going to trigger business rules with all those incident updates?

Why don't we ask ChatGPT if it knows what to do.

And yes, it appears it does!

The skeptic again might see places where ChatGPT is inefficient, inexperienced, or wrong. - Like when ChatGPT is asked to do date manipulation. It doesn't really "get" GlideDateTime objects (but then again, who really does)- ChatGPT doesn't like dotwalking very far. Rather than go thing.otherthing.parent.field, it will keep making new variables and use getReference.

But **THAT** is why you **STILL** need to learn to code in javascript. ChatGPT can do a ton of heavy lifting, and help you learn along the way, but you still have to verify it.

Once you get used to it, ChatGPT can...- write scripts for you- explain the scripts its written- explain other ServiceNow concepts- remember conversations- be there for you even at 3am.

**CONCLUSION**

\- Learn how to code- Accelerate your learning by using ChatGPT as you go.- Learn how to Prompt ChatGPT as part of your "learning to code" practice.

[](https://www.servicenow.com/now-platform/latest-release.html)

View original source

https://www.servicenow.com/community/developer-articles/should-servicenow-admins-learn-javascript-and-does-chatgpt/ta-p/2508628