Skip to main content

addMetadataBatch(data, addToUserProperties?)

Efficiently adds an object's keys and values as metadata keys and values to Command AI. 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 Command AI will be the object's keys and values.