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

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Mudit Sharma
ServiceNow Employee
ServiceNow Employee

Last update date: 20th Aug’20

Latest Version: ServiceNow Extension for VS Code 1.5.0

 
Q.1 Are there any pre-requisites to install the ServiceNow extension for VS Code?
You need VS Code 1.38.0 and above and node.js version 8.0 and above.

 
Q.2 Which operating systems are supported?
Windows 10 and Mac 10.10+ are both supported.

 
Q.3 What are the applications supported by the extension?
 The extension supports the development of different types of ServiceNow applications such as custom apps and store apps. Users can work on the packages and plugins by enabling them from user settings.   

 
Q.4 Can I create applications from the extension?
ServiceNow extension version 1.5.0 supports only importing an existing application. You can log in as an ‘admin’ while working with the extension. ‘maint’ and ‘delegated developer’ are not supported.

 

Q.5 How do I open an instance of a file type that does not have any script field in it?
They open in your default browser. You can configure settings to open them in the embedded browser by default. This is not recommended though as the embedded browser has degraded performance.

 
Q.6 Where do I find installation/usage instructions?
Refer to details provided under link with heading ‘Documentation’ under Details tab in VS Code. You can also find documentation on our developer site.

 

Q.7 How do I report an issue I faced while working with the extension?
You can post your query/feedback on the community VS Code Extensions for ServiceNow.
Chose forum as 'Developer Community' and topic as 'VS Code Extensions for ServiceNow'.
We are happy to help. 

 
Q.8 Which ServiceNow releases are compatible with the extension?
v1.5.0 VS Code extension is compatible with the Orlando and NewYork release. We would release a new version of the extension with every ServiceNow release. These would be backward compatible.

 

Q.9  How can I work on global files if I don’t have any scoped application to “Create Project”?
You can create a global application product for your global application by logging into the instance.
You can then choose this application to import via the “Create Project” flow.


Q.10 What are **.script.js files?
These files contain script code, for example, for a script include myScriptInclude, you will see file myScriptInclude.script.js created.
      Similarly, for a UI page, myUIPage, you would see three files - myUIPage.client_script.jsmyUIPage.processing_script.js, and myUIPage.html as a UI page has three script fields in it.

 

Q.11 Are the ESlint rules configured on the instance applicable to the extension?
Yes, all the configurations applied via properties file glide.ui.syntax_editor.linter.eslint_config are applicable within the extension.

 

Q.12 Can I work offline or do I always need to be connected to an instance?
Yes, you can work offline. There is no need to be connected to an instance while writing script code. Once connected, you can sync your file to the instance.

 

Q.13 What is Sync current project?
It will sync all the files present in the current project between the instance and the extension.
a) It would also download any new files in the project on the server.
b) A new file created in the extension would be uploaded to the instance.
c) Changes done to a file on the server/extension are synced. Merge conflict is raised, where applicable.

 

Q.14 What is the difference between "Sync current project" and "Sync current file?"
Sync current project is applicable to all files in the current project. The name of the current project can be seen in the toolbar at the extreme right end.
Sync current file would sync changes made to the currently selected file only.

 

Q.15 How do I know the update set in which changes are done from the extension?
You can see the name of the current update set in the toolbar at the right-hand corner. You can select another update set by clicking on the name in the toolbar or using command Now: Select update set from the command palette.

 

Q.16 While creating a file I don’t see an option to enter details apart from selecting the file type and entering the name of the file. How do I enter data like table name?
You can only enter the type and name of the file to be created. All other metadata needs to be entered by logging in to the instance through the browser.
Any file type which has a mandatory field, apart from the name, cannot be created from the extension. However, if already existing in the application, you can edit them from the extension.

 

Q.17 Once I create a project, can I change its settings?
Yes. The details of the currently selected project are listed out here.
       For Mac: Navigate to Code > Preferences > Settings > Workspace > Extensions > Now
       For Windows: Navigate to File > Preferences > Settings > Workspace > Extensions > Now

 
Q.18 What happens to the file types which can be accessed only by ‘maint’ user?
Such file types are not supported by the extension.

 
Q.19 I chose ‘Embedded Webview’ as my default GUI program. But nothing happens when I open a file?
The webview internally uses the Chrome browser. Please check if you have Chrome installed.

 
Q.20 How do I make additional code snippets available?
Snippets are auto-imported from ’Syntax Editor Macros’ table into your instance. You can define additional macros here.

 
Q.21 I have some additional tables that need to be supported in the extension. How do I do that?
Additional file types such as tables can be added to your project using the Now: Add Custom file types command from the command palette and specify the table you want to add.
Files from this table would be downloaded on the next sync of the project with instance and onwards. Details are captured in a project-specific file called app.config.json.

Q.22 I want to have similar custom files across multiple projects. Do I need to re-enter the names of all tables via custom file types command?
You can copy app.config.json file from the current project to the new project to enable custom file types in it.

Q.23 I skipped adding some file types during import. Can I alter it later?
You can change your file types preference using Now: Configure file types command from the command palette.


Q.24 Can I edit the file I searched for? 
Yes, starting from version 1.3.0, the user can edit the file irrespective of the scope given the user has the required privileges. The users can use the file search functionality and search for the file which they would like to modify. Once the changes are done, the user can sync the file. 

  • a) What is the update set for this file on sync?
    In the toolbar you can see an additional update set picker once you open a file from a scratch folder. The 2nd update set picker from right hand side is for currently open scratch file and is populated based on the application the file belongs to. You can choose available update set to which you want to sync the scratch file too.

 
Q.25 How does the Telemetry, introduced as part of version 1.3.0, work? Does it capture any personal details? What is the purpose?
Telemetry collects anonymous information related to usage and does not capture any personal information such as name and email ID of the users. Data is accessible to ServiceNow only and is not shared with anyone.

We intend to use this data to understand how our customers are using the extension and identify areas of improvement based on usage statistics of each feature provided as part of the extension.


Q.26 I do not want ServiceNow to capture my usage information. Can I disable Telemetry from the extension?
Telemetry is enabled by default for the ServiceNow extension. If you do not want to send usage data, you can set the now.telemetry.enableTelemetry user setting to false.


Q.27 What are the hot keys available in ServiceNow VS Code extension?

Command

Mac​ OS

Windows

Sync Project

CMD + OPT+ S

CTRL + ALT + S

Sync Current File

CMD + OPT + SHIFT +S

CTRL + ALT + SHIFT +S

Search File

CMD + OPT + F

CTRL + ALT + F

Show Update set Picker

CMD + OPT + U

CTRL + ALT + U

Show Application Picker

CMD + OPT + A

CTRL + ALT + A

 

Q.28 What is the “background scripts” folder used for?
You may need to re-execute a background script multiple times over a period of time. You can create files in this folder with such scripts.
  Files in this folder don’t participate in the sync process.

Q.29 Can I get rid of the green color on the sidebar and toolbar?

Yes, you may remove the theme added by extension.

       For Mac: Navigate to Code > Preferences > Settings > Workspace > Extensions > Now
       For Windows: Navigate to File > Preferences > Settings > Workspace > Extensions > Now

Uncheck property Theme: Enable Theme to get rid of the theme added.

 

Q.30 If I delete an application file on my system, would it be deleted from the instance on syncing the project? Is there a way to prevent it?

Property Sync: Enable Deletion governs this behavior. 
If this property is unchecked then a file deleted on the client would be re-downloaded on sync.
If this property is checked then a file deleted on the client would be deleted from the instance as well on sync.

 
Troubleshooting


1. When I open the ServiceNow extension for VS Code and set up a workspace or add a folder, I get the following error:

Extension ServiceNow failed to update workspace folders: Error: ENOENT: no such file or directory, stat '/Users/<<username>/Library/Application Support/Code/User/workspaceStorage/ext-dev/state.vscdb'.

What do I do?

Looks like your VSCode storage is full, empty '/Users/<<username>>/Library/Application          Support/Code/User/workspaceStorage folder.


2. I am unable to sync my project and my project appears to be corrupt.

   You can reset the project to the state on the server using Reset project command from the command pallet.


3. After installing the ServiceNow extension, I am getting the command not valid/not found error.

    Check your node.js version. It should be 8.0 or above.


4. In some versions of VS Code, OK button is not available in multi-selection quick-pick lists (e.g. File type selection screen). What do I do? 

This is a bug present in VS Code versions 1.42.0 and 1.42.1 

(https://github.com/microsoft/vscode/issues/90365). As a workaround, you can hit Enter, after you are done with your item selection to proceed to the next screen.  

 

Comments
Jace Benson
Mega Sage

I keep getting authentication issues after I choose the thing to import.

So here's my steps and I'm getting those auth issues every time;

Open terminal.
Make folder "nowtesting"
Change directory to nowtesting

mkdir nowtesting
cd nowtesting
code .

Now that I'm in VS Code, It looks like a normal window (not the teal once the plugin is activated)
Press command + shift + p
(I've tried this in both orders) "Now: Activate Now Extension" and "Now: Setup Now Workspace"
(Once "Setup Now workspace" is selected you must select a folder or make new as noted here
Select project folder, "nowtesting" in my ~/ directory
Click on Create Project or command + shift + p then selecting "Now: Create Now Project"
VS Code asks for the endpoint, I enter my PDI,https://dev84821.service-now.com/
VS Code asks for my credential type, I pick Basic Auth
VS Code asks for my username, I type it, press return
VS Code asks for my password, I type it, press return
VS Code shows on the bottom right "Success! You are authenticated."
VS Code still shows the "Project wizard (1/5)" at the top, I choose "Custom Application"
VS Code shows "Project wizard (2/5)" at the top, I choose "Import existing" (no other choice, not sure why it asks)
VS Code shows "Import project (3/4)" and lists custom scoped applications on my instance. I pick one, and click on or use down and then return
VS Code shows "Import project (4/4)" and shows a list of tables pre-checked. I click on "OK" or press return
VS Code shows "Authentication (1/4)" and the bottom right jumps between messages.

I looked at the documentation. I followed what I could. The intstructions you left are not clear how I am doing it wrong and or differently.

Mudit Sharma
ServiceNow Employee
ServiceNow Employee

hi jacebenson,

   We would be glad to help you resolve this issue. Can you please post it as a question on 
https://community.servicenow.com/community?id=community_topic&sys_id=fcf9b40edb60841c2be0a851ca9619a... along with details of VS Code version and node.js version you are using.

Thanks,
Mudit Sharma

  

Jace Benson
Mega Sage

I would if I could, but "VS Code Extensions for ServiceNow" is not selectable forum when I go to post a question.

Mudit Sharma
ServiceNow Employee
ServiceNow Employee

hi jacebenson,

 you can go to this link to ask a question. Enter forum as "Developer Community" and topic as "VS Code Extensions for ServiceNow".

  I have edited FAQ's question #7 to reflect the same. Thanks for pointing out !

Thanks,
Mudit Sharma

 

 

Martin76
Kilo Expert

Hi, I couldn't find information about how we can contribute to the plugin development in the FAQ.

For instance, I've been recently working on table-aware type checking for ServiceNow and I was wondering if we could make it work together.

Thanks

Martin

find_real_file.png

Shuvjit1
ServiceNow Employee
ServiceNow Employee

As of now, we have no plans to make the extension open source. In case you have any feedback for us please do share it here.

Jace Benson
Mega Sage

Can you share why?

olivierbousquet
Tera Expert

Hello everyone,

The plugin works also on Chrome OS. If you meet a problem, you can find the solution on following community post: When I try VS code extension on Chromebook (linux), I cannot import an app 

Thanks a lot for this plugin, you make my day (week, month, etc.).

Regards, Olivier.

Sami Koskivaara
Giga Contributor

I have admin rights to our ServiceNow instance. It has domain reparation and my account is not in the global, but couple domains down. We have basic authentication and I can login to ServiceNow instance from GUI and manage my application scope.

When I setup a new VS Code workspace I can authenticate the first time it asks credentials and select my custom application but when it wants to download the app, it stops (24 / 174) and says Oauth token expired and asks me to authenticate again over and over again. It basically doesn't download the app scope and I can't see any of the scripts. Only folder structure is created. Please help!

olivierbousquet
Tera Expert

Hi Sami,

Could you give it a try to setup basic auth instead of OAuth ? Just to know wether it could be tied to Oauth or not.

Regards, Olivier.

Martin Ivanov
Mega Sage
Mega Sage

@Mudit Sharma, could you please further elaborate on Q9 by providing step-by-step guide? I really don't understand what is meant under 'You can create a global application product for your global application by logging into the instance.' Thanks!

Karl Martin Lun
Tera Contributor

Hey @Mudit Sharma @Shuvjit1 

I've having some trouble using ES21 in VS Code. I have described the issue in this community post:

https://www.servicenow.com/community/developer-forum/using-ecmascript21-in-vscode-makes-syntax-error...

 

Are you able to help me resolve this, please?
Best regards

Harshavardhan_k
Tera Contributor

Hi @Mudit Sharma , 
I am unable to get all folder structures present under src folder, ex client development folder is not present.

Screenshot 2023-05-31 at 5.15.20 PM.png

should have all these below mentioned folders.

should have these all folder structuresshould have these all folder structures

 

Could you please help me regarding this. is it possible to use UI builder scripts in vs code?

Prakhar7
ServiceNow Employee
ServiceNow Employee

I'm getting this error:

command 'now.activateServiceNowExt' not found

I'm on:

  • node version 20 
  • vscode 1.83.0
  • extension version 1.6.1

Not sure how to get around this

samkikalis
ServiceNow Employee
ServiceNow Employee

@Prakhar7  it looks like there is a compatibility issue with the latest version of VSCode (Sep release 1.83) and reverting back to Aug release seems to work (https://www.servicenow.com/community/developer-forum/vs-code-extension-error-activating-extension-se...)

Version history
Last update:
‎11-06-2019 11:00 PM
Updated by: