Pass value from Client script to Widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2020 06:57 AM
Hi,
On service portal record producer, i have an onchange client script - i would like to pass a certain value from the client script, to another variable of Macro type, implemented by a widget.
So basically i'm trying to pass a value from the on change client script to that widget.
Appreciate any help / advice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2020 08:51 AM
Hi Elig,
You can refer the links below which says the same thing.
In this thread they have said that if you need the variable value in widget then you can directly use it :
In the widget client controller you can use this
$scope.$watch(function () {
return $scope.page.g_form.getValue('my_variable');
}, function (value) {
//Do stuff with value
}
for more detailed explanation:
The other links.
https://www.jds.net.au/servicenow-catalog-client-scripts-g_form-clear-values/
https://hi.service-now.com/kb_view.do?sysparm_article=KB0728388
Mark helpful and correct if it helps.
Thanks,
CB
