Item Import
- optional
A Template Package can include items that are intended to be created in the Item Service of the selected project during deployment. The target collection and the names of the files containing the items to be created are defined in the manifest.itemsToCreate array. Additionally, the user can specify how the system should behave when items already exist in the target collection using the optional ifExists field.
The actual JSON files containing the items must be placed in the itemsToCreate folder within the ZIP archive. This folder uses a flat structure, meaning all JSON files are stored at the same level without subfolders. The user can define multiple files for single target collection. Each JSON file must contain an array of items to be created. The system should be able to match file names defined in the manifest.itemsToCreate with files found under the itemsToCreate folder.
The ifExists field controls how the system handles existing items in the target collection:
- If omitted, the items in the JSON file are not created.
- If set to "add", the items are created even if the collection already contains items.
- Any other value, including "default", will result in the items not being created.
Complete Example:#
// manifest.json{ "Template Name": "Water Treatment Operations Digital Twin", "Template Version": "1.0.5", "itemsToCreate": [ { "collectionName": "Default Collection", "items": [ { "file": "default-items.json", "ifExists": "default" }, { "file": "update.json", "ifExists": "add" } ] }, { "collectionName": "Version Collection", "items": [ { "file": "second-items.json" } ] } ]}// Package Zip FileWater Treatment Template.zip /|-- itemsToCreate /|| |-- default-items.json|| |-- second-items.json|| |-- update.json||-- manifest.json// default-items.json[ { "Operation Name": "Water Treatment", "Operation Details": { "Address": "London", "Numer of Employees": 120, } }, { "Operation Parameters": [ "Parameter One", "Parameter Two" ] },]// update.json[ { "Operation Name": "Water Treatment Phase Two", }, { "Operation Name": "Water Treatment Phase Three", },]