This sounds useful indeed.
Maybe textselect field can be modified to behave like this with a new parameter, of course it will need some work.
also its name is appropriate

textselect !!!,
--
currently the purpose of textselect field is to create
customized filter via a custom SQL query and via extra parameters