Scoped GlideSPScriptable - getWidget(String sysID, Object options)

Gets a widget by id or sys_id, executes that widget's server script using the provided options, then returns the widget model.

Table 1. Parameters
Name Type Description
sysID String The widget sys_id or widget_id
options Object An object to pass to the widget's server script. Refer to this object as options in your server script.
Table 2. Returns
Type Description
Object A widget model to be used with sp-widget.
//Server script
data.myWidget = $sp.getWidget('widget_id', {p1: param1, p2: param2});

<sp-widget widget=""></sp-widget>