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
booleanReturns 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 stringWidget template name.
-
template_reference stringWidget template reference.
-
created_through stringWidget template name.
-
translated_through stringWidget template reference.
See Widget Template References for Question Editor Customization & Navigation for more information.
Related articles
- The
getWidgetMetadata()
method, which allows you to get the current Widget metadata.