Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

How do you access "widgetInput" or "shared" from inside the modal?

danbowman
Kilo Contributor

How do you access "widgetInput" or "shared" from inside the modal?

https://developer.servicenow.com/app.do#!/api_doc?v=london&id=SPM-open_O

  • widgetInput - an object to send the embedded widget as input. The default is null.
  • shared - a client-side object to share data with the embedded widget client script.
spModal.open({
            title: 'SUMMARY',
            widget: 'widget_summary',
			widgetInput: {
				test: 'test'
			}
        }).then(function(e) {
			// do something
        });

In widget_summary's HTML template how would "widgetInput" or "shared" be accessed and used?

 

1 REPLY 1

dylan_lindgren
ServiceNow Employee

I was also wondering the same thing, but then I found the below link which has a good example of how to use it:

https://github.com/service-portal/x-archive/blob/master/documentation/spModal.md