Attempting to add select endpoint to get payload

select endpoint name in ui to get json payload, but javascript part is
not working.

need to find a way to trigger select event.