Manage files in the config data model using file nodes
Add and manage files using file nodes in the config data model of a CDM app or in a component library.
Before you begin
Important: Starting with the Washington D.C. release, DevOps Config is being prepared for future deprecation. It will be hidden and no longer activated on new instances but will continue to be supported.
Role required: cdm_editor or cdm_admin
About this task
When you attach a file to an applicable node, a file node is created under that node. The file node contains a link to the attached file that stores configuration data. For example, a properties file or a logo image file.
- In an app, you can add the file node to a node under the component, collection, or deployable folder. The file nodes in a component are also included when you include a component to a collection and the collection to the deployable in an app. You can override the file nodes included at the collection or deployable level, like any other config data item.
- In a component library, you can add a file node to a node under a shared component. When the shared component is used in an app, the file nodes are copied along with the file attached to them.
App developers and members of the authoring group of the app can access the file nodes and also download their attached files. They can manually validate the content of the file and then publish the snapshot. DevOps users can export the validated config data, including file nodes with URLs to the attached files hosted on the ServiceNow instance where the export was executed.
Procedure
Navigate to All > DevOps Config > DevOps Config Workspace.
Open a DevOps Config app or a component library to add a file node to its config data model.
| Option | Steps |
|---|---|
| Adding a file node in an app |
|
| Adding a file node in a component library |
|
A changeset is opened with the **Config data** tab selected.
- In the config data tree, select the more actions icon (
More actions icon.\) next to a node to which you want to add a file node, and then select the **Add file** from the menu.
**Note:** In an app, you can add a file node to a node under the component, collection, or deployable, but not directly to the component, collection, or deployment folder in an app. In a shared library, you can add a file node to a node under a shared component.
Add a file to create a file node.
In the Add file dialog box, browse and select a file from your system, and select Add file.
You can add a MIME-type file supported by the ServiceNow AI Platform with a maximum file size of 5 MB.
In the Node name field, provide a name for the file node.
By default, the attached file name is populated as the file node name. The Content type field is also populated with the content type of the attached file.
Select Add file.
The file node is added to the selected node. Select the file node in the config data tree to display its metadata in the File information pane and preview the file's content in the File content pane.
Note: The content preview is available for the files with the following MIME types:
text/yaml,text/css,text/csv,text/html,text/javascript,text/plain,text/richtext,text/x-vcard,text/x-vcalendar,application/xml,application/javascript,application/json. To view content for additional MIME type files, add them as a comma separated list to the system property sn_cdm.attachment.display_mime_types. The preview is not available for binary file MIME types, such as audio, image, and video.
A file node added to a component node.
After the file node is added to the config data, you can perform the following actions on the file node or the file attachment within it.
Note: All actions on the file node or its file attachment can only be done via the More actions menu on the file node.
| Action | Steps |
|---|---|
| Rename the file node |
|
| Extract variables |
You can then resolve all the extracted variables. Define the extracted variables and then select Apply variables from the form context menu. This action replaces all extracted variables in the file content with the defined variable values. |
| Delete the file node |
|
| Download the file attachment | Select the more actions icon next to the file node, and then select Download file from the menu.Alternatively, you can download the file by selecting the file node and then selecting Download on the File information pane. |
| Replace the file attachment |
|
| Override an included file node | If a file node is included in a collection and into a deployable, then you can override it by replacing the attached file with a new one.1. Select the more actions icon next to the included file node in the collection or deployable folder, and then select Replace file from the menu. 2. In the Replace file dialog box, attach a file from your system, and select Replace file. |