How do we know if we should use helpers.navigate.to vs api.emit method in UI builder client scripts?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2022 06:19 AM
I have button component on a page and want to navigate to another page with some payload when a button is clicked. When i see the OOB apps, some use api.emit and some use helpers.navigate.to methods. How do i know which one to use?
Also, where can i find information on creating handled events/dispatch events etc.?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2022 11:38 AM
The helpers.navigate.to function is one among many shortcuts that the helpers API provides. If one helpers function performs what you need you're all set.
You can find more information on the Developer API reference page: https://developer.servicenow.com/dev.do#!/reference/api/sandiego/client/helpersAPI