IPWorks Cloud 2020 Node.js Edition

Questions / Feedback?

MetadataValueType Property

The type of the metadata item's value.

Syntax

 box.getMetadataValueType(index, [callback])
 box.setMetadataValueType(index,  metadataValueType, [callback])

Possible Values

  0 (mtString), 
  1 (mtNumber), 
  2 (mtMultiSelect)

Default Value

0

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for the getMetadataValueType([callback]) method is defined as:

function(err, data){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'data' is the value returned by the method.

The callback for the setMetadataValueType([callback]) method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

The type of the metadata item's value.

This property specifies the type of the metadata item's value, and controls how the class encodes MetadataValue when submitting it to the server. Possible values, and their corresponding Box types, are:

Value Type Encoded As Corresponding Box Types
0 (mtString - default) String string, date, enum (single-select)
1 (mtNumber) Number float (note: actually any numeric value, including integers)
2 (mtMultiSelect) Array of strings enum (multi-select)

The MetadataValue property should hold a comma-separated list of strings when this property is set to 2 (mtMultiSelect).

This property may be used as input when CreateMetadata or UpdateMetadata is called if the MetadataModOp property is set to one of the following:

  • 1 (opAdd)
  • 2 (opReplace)
  • 6 (opTest)

Important: Box only allows string-typed metadata items in the /global/properties metadata container; the class will always ignore this property and encode metadata items as strings when creating or updating the /global/properties container.

The index parameter specifies the index of the item in the array. The size of the array is controlled by the MetadataCount property.

This property is not available at design time.

Data Type

Integer

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Cloud 2020 Node.js Edition - Version 20.0 [Build 8265]