const instances = [
{ externalId: 'Well_a', templateName: "Well", fieldResolvers: { name: "Underwater P23", pressure: "21_PT19" } },
{ externalId: 'Well_b', templateName: "Well", fieldResolvers: { name: "Underwater P01" } },
];
const createdInstances = await client.templates.group("myGroup").version(1).create(instances);
const instances = await client.templates.group("myGroup").version(1).delete([{ externalId: ["Well_a"] }]);
Optionaloptions: { const instances = await client.templates.group("myGroup").version(1).list( { templateNames: ["Well"] } );
Optionalquery: TemplateInstanceFilterQueryconst instances = await client.templates.group("myGroup").version(1).retrieve([ { externalId: 'Well } ]);
Optionaloptions: { const instances = await client.templates.group("myGroup").version(1).update( [{ update: {
fieldResolvers: {
set: {
myStringField: "My Field"
}
}
}, externalId: 'someExtId' }] );
const instances = [
{ externalId: "Well_a", templateName: "Well", fieldResolvers: { name: "Underwater P23", pressure: "21_PT19" } },
{ externalId: "Well_b", templateName: "Well", fieldResolvers: { name: "Underwater P01" } },
];
const createdInstances = await client.templates.group("myGroup").version(1).upsert(instances);
Deprecated
Templates API was retired 2025-05-31 and will be removed in the next major release. See https://github.com/cognitedata/cognite-sdk-js/blob/master/guides/DEPRECATIONS.md for details.