Skip to main content

addMetadataBatch(data, addToUserProperties?)

Efficiently adds an object's keys and values as metadata keys and values to CommandBar. Use this when you want to add many keys/values already contained in an object as metadata.

Example

window.CommandBar.addMetadataBatch({
firstName: "Alice",
lastName: "Smith",
age: 31,
});

Method parameters

data Required

object

An object with one level of nesting (e.g. {valueA: 4, valueBp: 'aString'}). The metadata keys and values added to CommandBar will be the object's keys and values.

addToUserProperties

boolean

Whether or not to add the metadata to the user attributes object (see boot). Defaults to false.