Switch views based on values of a field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2022 06:02 AM
Hello,
I need to switch between views based on a field on the form.
The task is the following:
- if field "Test" is choice 1 -> view should be "view 1"
- if field "Test" is choice 2 -> view should be "view 2"
- if field "Test" is choice 3 -> view should be "view 3"
I created a view rule that does that:
The problem is with new records, is it possible to change views in a new record based on the user's choice?
I tried to do the same logic in onChange client script but I need to save the record in order to display a view.
Thank you,
Elena

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2022 11:41 PM
Hi,
onChange CS doesn't work. It makes the user save the form first and we do not want that.
On a new record, onLoad won't be an option, because the field is -None- and when the user chooses an option it will enter a loop. Tried it for testing purposes and it kept refreshing the page.
Have a nice one,
Elena
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2022 11:44 PM
Hi,
that's correct.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader