[Go to site: main page, start]

setFields

Add, update, or remove Collection fields.

await collection.setFields([
  { id: "1", type: "string", name: "Name" },
  { id: "2", type: "number", name: "Age" },
  { id: "3", type: "string", name: "Description", userEditable: true },
])

Fields not included in the array will be removed. You can configure up to 30 custom fields.

Each field requires an id, name, and type. For the id, use a unique identifier that stays the same across future synchronizations. Any change in id can break data assignments on the canvas. The maximum length for an id is 64 characters.

By default, managed collection fields set by a plugin are not editable by users. Set userEditable: true on a field to allow user editing. Note that fields marked as userEditable can no longer have their values set by the plugin when using addItems.

Parameters

Returns

  • Promise<void>