Passing data from the Form widget to a custom widget on the Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2024 03:38 AM
First question here so here's hoping - I'm trying to pass data from the built in Form widget on the Service Portal to a custom widget on the same page, but can't figure out the best way. I looked at scratchpad variables but many posts said that they can't be used in the Service Portal.
The ultimate aim is to capture data from the form (which is populated with data from the Asset table when it loads, I've just pixelated it here) and use it in the other widget on the same page to generate a new URL that contains the information stored in the Account, Serial Number, Model, and Location fields. This is so that I can read the information from the URL and use it to auto populate the fields in forms that are reached by clicking either the Order Consumables or Something is Broken links in my custom widget.
If I log $scope.data from the (pixelated) form to the console I can see all of the data I need contained within the object -> f -> _fields, but how do I get it from there into my own widget?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2024 04:29 AM
Hi @Davospike
you will need another approach. Please refer to the following article: https://www.servicenow.com/community/developer-articles/how-to-comunicate-between-widgets-service-po...
Maik