Public Method Author API

setWidgetMetadata()

Set the Widget metadata, when editing a Widget in an Item.

You would want to use this method so that you can change the Widget template metadata information, for example.

Examples

var hasUpdatedMetadata = authorApp.setWidgetMetadata({
    "template_reference": "908de244-5c71-4c09-b094-7fb49554f2f9"
});
console.log(hasUpdatedMetadata);

Arguments

  • widgetMetadata object

    The new Widget metadata JSON. See widgetMetadata for more information.

Return value

boolean

Returns true if successful.

Returns false if unable to set the Widget metadata when not in the Widget editor view or if the passed metadata is not an object.

Type definitions

widgetMetadata object

  • name string
    Widget template name.
  • template_reference string
    Widget template reference.
  • created_through string
    Widget template name.
  • translated_through string
    Widget template reference.

See Widget Template References for Question Editor Customization & Navigation for more information.

Related articles

Was this article helpful?