Dynamic URL for Widget in Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2023 06:56 AM
I have a variable in our SP with type as Custom with label and associated into a widget. Whenever a user selects a specific service request menu, this widget will be displayed to download the specified application form. See widget code below.
We have hundreds of service request menus and each of them have different application forms and sysID. I want to make the sysID dynamic based on the selected service request menu so I don't need to create multiple widgets and variables. How can I achieve this requirement?
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2023 07:35 AM
@Paolo2 Write below function in the client controller of widget used in custom with label variable
$scope.$watch(function() {
c.data.serviceRequestId = $scope.page.g_form.getValue("service_request")
});
Please mark as correct answer if this solves your issue.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2023 07:54 AM
Thank you very much! Let me try this.