Service Now Code Snippets for VS Code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2017 01:44 PM
Hey Guys,
I am new to service now scripting and want to make it easier. I created snippets based off of service now documentation. I use VS Code (Its Free!) to write my scripts.
To set up
- Download Visual Studio Code - Code Editing. Redefined
- Download and open the snippets file attached to this.
- Copy the contents.
- Open VS Code
- Navigate to File > Preferences > User Snippets
- Select Javascript from the dropdown
- Paste this over current (Unless you have existing snippets you created).
- Test in a new javascript file.
About This file
- All snippets prefixed with sn_
- Separated in main categories
- sn_query - Basic Queries
- sn_delete - Delete records
- sn_insert - Insert New records
- sn_addquery - Additional snippets to add query filters
- sn_alert - Different alerts for client and server side scripts
- sn_user - client and server snippets for the user object
- sn_form - snippets for the g_form object
- Easy to change any names by changing the prefix within the file.
Screenshot
This may not be perfect but can be a good place to start. Hope this helps someone.
- Labels:
-
Scripting and Coding
- 3,570 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2018 06:28 AM
Wow, great job @johansec. I was just about to do this and decided to do a quick community search to find you've already done it! Thank you for sharing.
My next target is getting the core Glide API in intellisense. I'm pretty sure it can be done using JSDoc annotations or a Typescript declaration files but I don't know how to get the benefit without importing something before each project. Let me know if you want to collaborate on this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2019 09:19 AM
@johansec thanks for doing these snippets! @danpatino let us know when you've completed your Glide API in Intellisense!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2020 03:06 AM
I would suggest you to try an IDE like Syfer. It has options to quickly generate code code snippets for GlideRecord and GlideAjax. It also provides good intellisense options for both client and server side scripts.
It is available as free app on ServiceNow app store.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2020 10:08 PM