ModifyMetadataTemplate
Modifies a Box metadata template's schema.
Execute
Modifies the schema of an existing metadata template.
When a required input is missing, the error message names both the input and the current Op value (for example, "Input 'FieldKey' is required when Op='addField' for procedure ModifyMetadataTemplate.") so that callers can tell which value to supply for the operation they requested.
editTemplate
Modify template-level properties (display name, hidden flag, copy-on-copy flag) on an existing template.
EXECUTE ModifyMetadataTemplate
TemplateKey = 'qa_template',
Op = 'editTemplate',
DisplayName = 'QA Renamed',
TemplateIsHidden = 'true',
CopyInstanceOnItemCopy = 'true';
addField
Add a new field to an existing template. FieldKey, FieldType, and FieldDisplayName are required for every variant.
String field:
EXECUTE ModifyMetadataTemplate
TemplateKey = 'qa_template',
Op = 'addField',
FieldKey = 'f3',
FieldType = 'string',
FieldDisplayName = 'Field 3',
FieldDescription = 'Added by addField';
Enum field with options:
EXECUTE ModifyMetadataTemplate
TemplateKey = 'qa_template',
Op = 'addField',
FieldKey = 'f4',
FieldType = 'enum',
FieldDisplayName = 'Field 4',
FieldOptions = 'alpha,beta,gamma';
MultiSelect field with options:
EXECUTE ModifyMetadataTemplate
TemplateKey = 'qa_template',
Op = 'addField',
FieldKey = 'f5',
FieldType = 'multiSelect',
FieldDisplayName = 'Field 5',
FieldOptions = 'red,green';
editField
Update the display name, description, or hidden flag of an existing field. Pass FieldNewKey to rename the field key in place.
EXECUTE ModifyMetadataTemplate
TemplateKey = 'qa_template',
Op = 'editField',
FieldKey = 'f1',
FieldDisplayName = 'Field 1 (renamed)',
FieldDescription = 'Renamed by editField',
FieldIsHidden = 'false';
removeField
Remove a single field from the template. Other fields are unaffected.
EXECUTE ModifyMetadataTemplate
TemplateKey = 'qa_template',
Op = 'removeField',
FieldKey = 'f5';
reorderFields
Reorder the existing fields. Supply the desired order as a comma-separated list of field keys on the FieldKey input.
EXECUTE ModifyMetadataTemplate
TemplateKey = 'qa_template',
Op = 'reorderFields',
FieldKey = 'f4,f3,f2,f1';
addEnumOption
Append a single option to an existing enum field. FieldKey selects the field; OptionKey is the new option key to add.
EXECUTE ModifyMetadataTemplate
TemplateKey = 'qa_template',
Op = 'addEnumOption',
FieldKey = 'f2',
OptionKey = 'optC';
editEnumOption
Rename an existing enum option in place. OptionKey identifies the existing option; OptionNewKey is its new key.
EXECUTE ModifyMetadataTemplate
TemplateKey = 'qa_template',
Op = 'editEnumOption',
FieldKey = 'f2',
OptionKey = 'optA',
OptionNewKey = 'optA_renamed';
removeEnumOption
Remove a single option from an enum field. The field itself is left in place.
EXECUTE ModifyMetadataTemplate
TemplateKey = 'qa_template',
Op = 'removeEnumOption',
FieldKey = 'f2',
OptionKey = 'optC';
reorderEnumOptions
Reorder the options of an enum field. Supply the desired order as a comma-separated list of option keys on the FieldOptions input.
EXECUTE ModifyMetadataTemplate
TemplateKey = 'qa_template',
Op = 'reorderEnumOptions',
FieldKey = 'f2',
FieldOptions = 'optC,optB,optA_renamed';
addMultiSelectOption
Append a single option to a multiSelect field. Same input shape as addEnumOption.
EXECUTE ModifyMetadataTemplate
TemplateKey = 'qa_template',
Op = 'addMultiSelectOption',
FieldKey = 'f5',
OptionKey = 'blue';
editMultiSelectOption
Rename a multiSelect option in place.
EXECUTE ModifyMetadataTemplate
TemplateKey = 'qa_template',
Op = 'editMultiSelectOption',
FieldKey = 'f5',
OptionKey = 'green',
OptionNewKey = 'green_renamed';
removeMultiSelectOption
Remove a single option from a multiSelect field.
EXECUTE ModifyMetadataTemplate
TemplateKey = 'qa_template',
Op = 'removeMultiSelectOption',
FieldKey = 'f5',
OptionKey = 'blue';
reorderMultiSelectOptions
Reorder the options of a multiSelect field.
EXECUTE ModifyMetadataTemplate
TemplateKey = 'qa_template',
Op = 'reorderMultiSelectOptions',
FieldKey = 'f5',
FieldOptions = 'blue,green_renamed,red';
Input
| Name | Type | Description |
| TemplateKey | String | Unique key of the template to modify. |
| Op | String | JSON-patch operation to perform on the template. One of: editTemplate, addField, editField, removeField, reorderFields, addEnumOption, editEnumOption, removeEnumOption, reorderEnumOptions, addMultiSelectOption, editMultiSelectOption, removeMultiSelectOption, reorderMultiSelectOptions. |
| DisplayName | String | New display name. Used with Op=editTemplate. |
| TemplateIsHidden | Boolean | Whether the template is hidden from the UI. Used with Op=editTemplate. |
| CopyInstanceOnItemCopy | Boolean | Whether metadata is copied with the item. Used with Op=editTemplate. |
| FieldKey | String | Key of the field being added, edited, removed, or whose options are being changed. For Op=reorderFields, supply a comma-separated ordered list. |
| FieldNewKey | String | The new Key of the field. Use this input when you want to change the field Key. Used with Op=editField. |
| FieldType | String | Data type of the field (string, float, date, enum, or multiSelect). Used with Op=addField. |
| FieldDisplayName | String | Display name of the field. Used with addField or editField. |
| FieldDescription | String | Description of the field. Used with addField or editField. |
| FieldIsHidden | Boolean | Whether the field is hidden. Used with addField or editField. |
| FieldOptions | String | List of option keys for enum and multiSelect fields. Used with Op=addField, Op=reorderEnumOptions, or Op=reorderMultiSelectOptions . Accepts a comma-separated list (for example 'a,b,c'). |
| OptionKey | String | Key of the affected enum/multiSelect option. Used with Op that concerns adding, editing, removing an option from an enum or multiSelect field. |
| OptionNewKey | String | The new Key of the Field Option. Use this input when you want to change the Option Key of the Field. Used with Op=editEnumOption, or =editMultiSelectOption. |
| AsUserId | String | Identifier of the user to impersonate. Available only for Admin, Co-Admin, and Service Accounts. |
Result Set Columns
| Name | Type | Description |
| Success | Boolean | True when the template change was applied successfully. |