Populate the catalog variable in the form on field change from the SC Catalog Item widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
I have cloned/customised the SC Catalog Item widget and trying to do a simple population of the variable in the catalog item when a certain field changes.
$scope.$on("field.change", function(evt, params) {
if (params.field.name == '<variable that triggers the population') {
<set the value of another variable>
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago - last edited 3 hours ago
is there any specific reason that why you want to populate variable data through widget?
You can use catalog client script to populate variable data.
You can refer to the following posts for more information:
https://www.servicenow.com/community/developer-forum/autopopulate-user-details-onchange-of-user-name...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
The reason is that we are trying to do something related to the Save as Draft functionality. Once the field changes, we are calling the Save as Draft popup. And when the draft is saved, we want to populate a certain field. And from the client script, we can execute some other logic.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Save as Draft is available as OOTB feature.
You can enable that for your portal and then enable it for your catalog item
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
what's your actual business requirement here?
what are you doing with that cloned widget?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader