I've created a layer in GeoServer. The layer is based on a SQL view and is parametrized as described in the documentation. I can access the WFS in the browser with a URL something like the below:
http://localhost:8080/geoserver/wfs?service=WFS&version=1.0.0&request=GetFeature&typeName=cite:mylayer&maxFeatures=50&outputFormat=application%2Fjson&viewparams=myuuid:2a18bb306af24e29a8f1a40f80229749;myyear:2016
(Note the viewparams
part at the end of the query string.)
But I don't see a way to set these parameters in QGIS when I'm adding the layer. I can connect successfully and find my layer in the list, but there doesn't seem to be a way to configure these parameters:
How can I set these parameters? Does the Build query functionality allow me to via some mechanism I'm not aware of?
http://localhost:8080/geoserver/wfs?VIEW_PARAM=my_param&
. This may work if QGIS does not use the GetFeature URL that comes with the GetCapabilities. Even if it happens to work you can't make it dynamic but you must create a new connection for each VIEW_PARAM value that you will need.