Product Feedback Forum
Help us make Sisense better by posting your product feedback here.
Showing results for 
Search instead for 
Did you mean: 
Status: New Idea

My team was adding scripts to widgets to add attributes to the embedded widget and noticed an opportunity to expand what metadata we can use in the scripts. Currently, we're using the widget description (`desc` field) to set a testid attribute, but by default that description is viewable in the embedded widget. 

I'd love the ability for designers to add key/value pairs to the Widget class metadata that are accessible in the widget script.

widget.on('domready', function(w) {
  const { oid, customMetadata } = w; // customMetadata is the new (optional) property on a Widget
  const testId = customMetadata['testId']; // a key/value pair added by designer
  const selectorString = `[widgetid='${oid}']`;
  const widgetElement = $(selectorString);
  widgetElement[0].setAttribute('testid', testId);