Forcing a custom view on a form on Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2022 03:36 AM
Hello,
I need to force a custom view on an incident form present on service portal. What are the best options of achieving this?
If possible, pls provide solution with an example. Thanks
- Labels:
-
Service Portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2022 03:40 AM
Hi,
You need to pass view name in the URL as a parameter when you are opening any record using form page.
Also check below link:
https://community.servicenow.com/community?id=community_blog&sys_id=003d2ae5dbd0dbc01dcaf3231f961932
Thanks,
Anil Lande
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2022 12:04 AM
Hey Anil,
Thanks for replying.
I'm using this data table from instance definition widget to show the list of records, and basically when i click a record a form opens on which i have forced a custom view as i did not want the 'sp' view.
So in order to force a custom view, i made changes in the server script of data table from instance def widget.
Just replaced view: "custom view name" under widget parameters mentioned in the script.
So, i want to know if there's any downside of using this approach in case you're aware

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2022 12:19 AM
Hi,
As you have customized OOB widget and added view as per your requirement there is no issue as long as no one is using this widget.
In future if anyone decide to use custom data table widget then they will be farced to use your hardcoded view.
Thanks,
Anil Lande
Thanks
Anil Lande

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2022 12:25 AM
Instead of hardcoding you can make it dynamic by using Options schema.
Please check below documentation.
If you add options schema then you can specify view in options when you add it in multiple places.
view: options.view_name,
Thanks,
Anil Lande
Thanks
Anil Lande