Count the number of variables on a Grafana Dashboard

Hi guys,

is there a way to count the number of variables (separated by commas) in a grafana dashboard and use that value in a influxdb query?

Thanks,
Rodrigo