Add variable in Grafana Dashboard

I want to add a custom variable that allows me to filter the data where tag value for “process” equals to the variable value in grafana dashboard. I am able to add a custom variable to the dashboard with value options “process1”, “process2” and “process3”, but when I use this variable in the query as |> filter(fn: (r) => r[“Process ID”] == ${process}) it is giving me error undefined identifier process2. Although when I replace the variable ${process} with “process2” the query works correctly and filters out the data by that particular process, but it doesnt work when I use variable. How can I fix this issue?
I am using influxdb and flux query language
I tried using the variable in the flux query as |> filter(fn: (r) => r[“Process ID”] == ${process}) but it is not working

Also if there is another simpler way of filtering data on the tag value please let me know