The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Robert Fedoruk
Tera Sage
Tera Sage

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

RobertFedoruk_0-1678995618237.png

And what did ChatGPT return?

RobertFedoruk_1-1678995639918.png

 

 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()"

Skeptic.jpg

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

RobertFedoruk_2-1678995790797.png

 

To which ChatGPT responds....

RobertFedoruk_3-1678995818808.png

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.

RobertFedoruk_4-1678995902112.png

 

And yes, it appears it does!

RobertFedoruk_5-1678995928713.png

 

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.


 

Comments
bammar
Tera Guru
Tera Guru

Thank you for the great article including the visuals. With just reading your title I was going to say, if you want to do anything really cool yes, you need to know how to code. Even in this increasing world of click to configure/low/code/no code - the most empowered people with the most creative possibilities who can maximize the potential of ServiceNow will leverage custom code in my opinion.

 

I too have seen the power of chatgpt and a key component as you alluded to is knowing what to ask- the beauty of Chatgpt is as you said spinining out 90 percent of the framework of your code in mere seconds. I have found in some rare circumstances that ChatGPT suggested certain syntax or functions that were not compatible with ServiceNow (it turns out they could have been from other coding languages) The exact examples escape me at this time. But yes if your a dev with some experience you can trust but verify what ChatGPT provides and build on it to rapidly produce a great script. Also by being a good dev youd know about updateMultiple and disabling workflows and additional enhancements- and still be impressed chatgpt recognizes them.

If I had chatgpt as a beginner it would have been amazing, especially explaining code. I have also heard of something called co-pilot both for devs and Microsoft office.

 

I wonder if there will one day be a deeper integration with Servicenow where someone will type - I want the sys_id of the employee named Bob Jones or Build me a report - titled Incidents created by group today - and it will create it and save under your name / Create a Record producer for incident table that will prompt user for category, subcategory, description of issue etc etc .

 

AI is the most  exciting thing to me in IT since ServiceNow itself- I have never been one to say - oh this technology will take my job - I just think it will make the job more exciting and take the possibilities to the next level.

-O-
Kilo Patron
Kilo Patron

If ChatGPT was anything but an over-hyped sh..t, it would have answered: "Hey, wait a minute, how about using data lookups or decision tables, or something?" As it is, it is next to useless.

kevinanderson
Kilo Guru

I think ServiceNow should bring a chat GPT style interface to the various areas of the platform for creating modules (app engine studio, catalog editor, virtual agent studio, flow designer, etc) to help create application modules, and/or a github co-pilot like interface in script fields to assist with scripting.

 

Doing a copy paste back and forth between these tools outside of the SN platform is a little painful.  Having an AI based module authoring capability on platform would be amazing.  Hopefully, an AI solution tuned and customized for SN modules and SN platform architecture would resolve the observation above about the current limitations of chat gpt / co-pilot for SN related code suggestions.

 

The following idea portal entry needs more votes IMO


Utilize AI to create record producers / service catalog items by simply typing out the name, fields, case type for a service.

https://support.servicenow.com/now?id=view_idea&sysparm_idea_id=40e0afb91b9d615026e3c8cc1d4bcbcf&sys...

Ian Mildon
Tera Guru

I've found Chat GPT to be hit/miss on creating JavaScript and it will sometime return scripts that simply do not work due to syntax errors that have to be identified and fixed.

 

But with any type of AI, it will get better as it ingests and learns more. But I'm still not going to rely on it as I would rather keep my own JavaScript knowledge up. To me it's just another "prompt" to nudge me towards correct syntax on scripted functions I have not done before.

Robert Fedoruk
Tera Sage
Tera Sage

@Ian Mildon - I have too, which is why its an even better idea to learn Javascript as a ServiceNow admin.

Pandora's box is opened.  Can't put it all back.  People will increasingly use ChatGPT as a shortcut for either doing or learning.   MUST know how to code in order to ensure quality.

Version history
Last update:
‎03-16-2023 12:49 PM
Updated by:
Contributors