How to use dashboard variables in simple-json http datasource url

I have created a variable say for eg: “type”=“ubuntu”
I want to use this variable in SimpleJson datasource http url
for eg: http://localhost:8080/api/$type

On adding, it says “Datasource working”
But when the json request is made through panel, it doesnot resolve the variable
eg: In the response, the path remains as “path:’/api/$type’” instead of ‘/api/ubuntu’