FAQ for v1.5.0 ServiceNow VS Code Extension
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.js, myUIPage.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/</Library/Application Support/Code/User/workspaceStorage/ext-dev/state.vscdb'.
What do I do?
Looks like your VSCode storage is full, empty '/Users/<>/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.
Labels:
https://www.servicenow.com/community/developer-articles/faq-for-v1-5-0-servicenow-vs-code-extension/ta-p/2308333
