I have PostGIS spatial data. There I have my own function, that does something. I execute it from GeoServer:
select * from my_scheme.get_geom_all('%T_KEY%','%KPI_NAME%','%FLTR%')
This function gets params via a web app (
On GeoServer it work fine but I have not been able to duplicate it on QGIS.