Hi,
We have created a template with multiselect control as below:
var templateParams = new BoxMetadataTemplate()
{
TemplateKey = "multiselecttest",
DisplayName = "Multiselect Test",
Scope = "enterprise",
Fields = new List<BoxMetadataTemplateField>()
{
new BoxMetadataTemplateField()
{
Type = "multiSelect",
Key = "author",
DisplayName = "Author",
Options = new List<BoxMetadataTemplateFieldOption>()
{
new BoxMetadataTemplateFieldOption() { Key = "Author1" },
new BoxMetadataTemplateFieldOption() { Key = "Author2" },
new BoxMetadataTemplateFieldOption() { Key = "Author3" },
new BoxMetadataTemplateFieldOption() { Key = "Author4" },
new BoxMetadataTemplateFieldOption() { Key = "Author5" },
new BoxMetadataTemplateFieldOption() { Key = "janani" },
}
}
}
};
BoxMetadataTemplate template1 = await _boxClient.MetadataManager.CreateMetadataTemplate(templateParams);
We applied the above template to a specific file and tried to select few items in the control:
var templateParams = new List<BoxMetadataUpdate>()
{
new BoxMetadataUpdate()
{
Op = MetadataUpdateOp.add,
Path = "/author",
Value = "["Author2","Author3"]"
}
};
Dictionary<string, object> updatedMetadata = await _boxClient.MetadataManager.UpdateFileMetadataAsync(123456, templateParams, "enterprise", "multiselecttest");
We are getting the below error:
The API returned an error [BadRequest | f24yzjgucw9wt1ud.07d752f31b93145c314a9080315bc15f2] schema_validation_failed - instance type (string) does not match any allowed primitive type (allowed: ["array"]) (pointer: /author)