Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to set values to variables of catalog items embedded in spModal

Ro5
Tera Expert

Hello.
I created a gimmick that uses spModal to display catalog items when a button is clicked.
I want to set values to some variables of catalog items displayed with spModal, but how can I do that?
Below is the button script.

 

HTML:
<div class="panel-body">
<button ng-click="c.onWidget('widget-sc-cat-item-v2')" class="btn btn-primary post-btn ng-scope">reopen</button>
</div>

Client controller:
api.controller=function($scope, spModal) {
/* widget controller */
var c = this;
c.onWidget = function(widgetId, widgetInput) {
spModal.open({
title: 'Displaying widget' + widgetId,
   backdrop: 'static',
widget: widgetId,
widgetInput: widgetInput || {
sys_id: "401d4005c392b150f4fcf6977a0131af",
},
 size: 'lg',
 scope: $scope
}).then(function(){
console.log('widget dismissed');
})
}
};

Regards,
Ro

1 REPLY 1

chitra11
Tera Contributor

Hi, Did you get how to achieve this. We also need the same.