Loki query variable filtered by structured meta data

When using Loki as a datasource we are able to filter the query on structured metadata e.g. {label=~“value”} | metadata=~“metadatavalue”.

We’d like to do the same when creating a dashboard query variable - anyone know how we might achieve this?