Is there a way to script this following data table list select part into a jsl script?

As of now I have a script done, but only on one data table at a time, is there a function that I can call to make a data table list selector like the picture that I attached above, and upon selection, I can have my current data table updated accordingly? My not-so-flexible script now looks like this

I want to achieve this

Any help would be greatly appreciated!