Text variable to query

Hello,

Can anyone provide info about how to pass user-defined text variable to query. I am using Simplejson as datasource and I want to pass user-defined variables to this datasource. No database involved. Backend consists of Flask framework fetching REST API data.
I am new to grafana, help will be much appreciated.

@jangaraj @mefraimsson please suggest me here
Sourabh