Excel Add-In for Box

Build 26.0.9770

CreateMetadataTemplate

Creates a new Box metadata template, optionally seeded with one or more fields.

Execute

Creates a new metadata template, optionally seeded with one or more fields in a single API call.

You can supply the fields payload in two ways: as a JSON array on the FieldsAggregate input, or by populating the MetadataFields#TEMP temporary table and passing its name to the same input.

JSON FieldsAggregate

The simplest call provides only the required inputs:

EXECUTE CreateMetadataTemplate
TemplateKey = 'qa_create_minimal',
DisplayName = 'QA Minimal';

Template-level flags such as TemplateIsHidden and CopyInstanceOnItemCopy can be supplied alongside the required inputs:

EXECUTE CreateMetadataTemplate
TemplateKey = 'qa_create_flags',
DisplayName = 'QA Flags',
TemplateIsHidden = 'true',
CopyInstanceOnItemCopy = 'true';

A single field can be seeded by passing a JSON array on FieldsAggregate:

EXECUTE CreateMetadataTemplate
TemplateKey = 'qa_create_one_field',
DisplayName = 'QA One Field',
FieldsAggregate = '[{"key":"f1","type":"string","displayName":"Field 1"}]';

Multiple fields, including an enum with options, in a single call:

EXECUTE CreateMetadataTemplate
TemplateKey = 'qa_create_batch',
DisplayName = 'QA Batch',
FieldsAggregate = '[
  {"key":"name","type":"string","displayName":"Name"},
  {"key":"sev","type":"enum","displayName":"Severity",
   "options":[{"key":"low"},{"key":"medium"},{"key":"high"}]}
]';

A taxonomy field is configured through additional keys (taxonomyKey, taxonomyId, namespace) and the nested optionsRules object:

EXECUTE CreateMetadataTemplate
TemplateKey = 'qa_create_taxonomy_json',
DisplayName = 'QA Taxonomy (JSON)',
FieldsAggregate = '[
  {"key":"category","type":"taxonomy","displayName":"Category",
   "taxonomyKey":"category-tax","taxonomyId":"tax-12345","namespace":"enterprise",
   "optionsRules":{"multiSelect":false,"selectableLevels":[1,2,3]}}
]';

MetadataFields#TEMP aggregate

The second way is to populate the MetadataFields#TEMP temporary table and pass its name to FieldsAggregate. Each row in the temporary table becomes one field on the new template. The accepted columns are listed in the schema below.

INSERT INTO MetadataFields#TEMP (Key, Type, DisplayName) VALUES ('f1', 'string', 'Field 1');
INSERT INTO MetadataFields#TEMP (Key, Type, DisplayName, Options) VALUES ('sev', 'enum', 'Severity', 'low,medium,high');

EXECUTE CreateMetadataTemplate
TemplateKey = 'qa_create_temp',
DisplayName = 'QA Temp',
FieldsAggregate = 'MetadataFields#TEMP';

Taxonomy fields can also be configured through MetadataFields#TEMP by populating the taxonomy-specific columns:

INSERT INTO MetadataFields#TEMP (Key, Type, DisplayName, TaxonomyKey, TaxonomyId, Namespace, MultiSelect, SelectableLevels)
VALUES ('cat', 'taxonomy', 'Category', 'cat-tax', 'tax-12345', 'enterprise', 'false', '1,2,3');

EXECUTE CreateMetadataTemplate
TemplateKey = 'qa_create_taxonomy_temp',
DisplayName = 'QA Taxonomy (#TEMP)',
FieldsAggregate = 'MetadataFields#TEMP';

MetadataFields temporary table schema info:

Column NameTypeRequiredDescription
Key string true Unique key of the field within the template.
Type string true Field data type. One of string, float, date, enum, multiSelect, taxonomy.
DisplayName string true Display name shown in the Box web and mobile apps.
Description string false Help text shown alongside the field.
IsHidden boolean false If true, the field is hidden from the Box UI and only accessible through the API.
Options string conditional Required for Type=enum or Type=multiSelect. Comma-separated list of option keys (for example 'low,medium,high').
TaxonomyKey string conditional Required when Type=taxonomy. The taxonomy key.
TaxonomyId string conditional Required when Type=taxonomy. The taxonomy identifier.
Namespace string conditional Required when Type=taxonomy. The taxonomy namespace.
MultiSelect boolean conditional Required when Type=taxonomy. Whether the taxonomy field accepts multiple selections.
SelectableLevels string conditional Required when Type=taxonomy. Comma-separated list of taxonomy levels the user may pick from (for example '1,2,3').

Input

Name Type Description
TemplateKey String Unique key for the template within the enterprise.
DisplayName String Human-readable name of the template, shown in the Box web and mobile apps.
TemplateIsHidden Boolean If true, the template is hidden from the Box UI and only available through the API.
CopyInstanceOnItemCopy Boolean If true, applied metadata is copied along when the file or folder is duplicated.
FieldsAggregate String Optional list of field definitions to seed the new template. Accepts either: a JSON array, or a temporary-table populated by prior INSERTs.
AsUserId String Identifier of the user to impersonate. Available only for Admin, Co-Admin, and Service Accounts.

Result Set Columns

Name Type Description
Id String Unique identifier assigned by Box to the new template.
Success Boolean True when the template was created successfully.

Copyright (c) 2026 CData Software, Inc. - All rights reserved.
Build 26.0.9770