Need to add a catalog item field in Topic content widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
HI Community,
In Topic content widget i need to display a custom field from catalog item table in it.
How to do that help me with server side script and html.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @suuriyas ,
If you want to display a custom field from a catalog item inside a Topic content widget, you can in your widget server script fetch the catalog item record (e.g. using sc_cat_item and $sp.getParameter('sys_id')) and put the custom field value into data, then in your client controller use c.server.get(...) to retrieve it and in your HTML template simply render {{ c.data.<custom_field> }} (assuming ACLs allow read access) , this pattern is based on common ServiceNow techniques for exposing non default catalog item fields in portal widgets.....
If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
@suuriyas Do you want to customise the widget?
Topic Content is OOB "employee center" scoped widget which cannot be edited without being cloned.
Cloning means you will have to the add the cloned widget to OOB portal pages which are using the using this widget and also other widgets which are calling this widget.
This can lead to a major customisation and is not recommended as this will have high changes of code break in upgrades and will get flagged in Health scan.
Please mark the answer correct/helpful accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
HI @RaghavSh ,
Thanks for replying
Yes we have already done some minor customization on topic content widget we cloned that and updated as "topic content updated" and used that in portal.
But now i'm struck with how to display/add my field in that widget