We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

How to pass data from one widget to another widget on spModal popup

Not applicable

I need to pass data from one widget to another widget, second widget display over spModal popup.

 

In widget 1 , below is the code for calling spModal and adding widget:

 

$scope.getdata = function(data)
{

spModal.open({
title: "Invoice Detail - #"+data.invoice,
widgetInput: {"value": data.invoice},
widget: 'invoice_details',
buttons: [
]
}).then(function(response)
{

});

 

could you please guide me how i can access this data in second widget.

 

Thanks in advance

 
1 REPLY 1

Raghu Ram Y
Kilo Sage

Hi,

To pass data from one widget to another widget then you need to make use of "Broadcast" and "on" functions..

This link helps you.

I hope it clears your issue, if so please mark my response as both CORRECT and HELPFUL.