Dynamic dropdown over an external API request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2023 06:50 AM
I'm trying to create a dynamic dropdown, similar to Country-State-City logic. I have implemented this process logic before using vanilla JS where the selected ID is captured and sent to the following method as variable. Since I'm using ServiceNow services and UI Builder, I have to follow SN's structure. Here is how I've managed to build it so far.
The data from the dropdowns are coming from external api requests, therefore I'm using Transform - Data Brokers (data resources) for UI Builder in order to follow SN best practices. I'm able to get the data in the 'List Items' for the first dropdown however can't seem to find an event listener to get the id selected and send it back to the second Transform Data Broker programProfiles (dropdown). I have read I should use the 'Events' tab however I'm not familiar yet with this logic.
1. Should the 'Event' selected be over the data resource or over the component? If so what should be the 'Event Handler' for this scenario ?
2. Is using an Event the ideal way ?