JSON Datasource -> Add Variables to URL?
Posted: Wed Nov 03, 2021 6:34 pm
In my report I have a json data source that gets the json from an API endpoint we have constructed externally. For this example, we'll say that its https://myapi.com/GetMyJsonFile. This endpoint returns an array of records from a database in json format.
In the report I also have two variables: FromDate and ToDate. What I want to do, is being able to strap the values from these variables into the JSON url so that the endpoint can filter the results it queries before returning them
i.e.. ../GetMyJsonFile?from_date={FromDate}&to_date={ToDate}
Anyone got any tips how this could be done? I know we can do this with SQL queries by adding the variables like {MyVariable} in the query, but it doesnt seem to work for JSON datasource URLs. Is there an event I can tap into that occurs after variable values have been selected, but before the datasources are loaded so that I could modify the json datasource path value?

In the report I also have two variables: FromDate and ToDate. What I want to do, is being able to strap the values from these variables into the JSON url so that the endpoint can filter the results it queries before returning them
i.e.. ../GetMyJsonFile?from_date={FromDate}&to_date={ToDate}
Anyone got any tips how this could be done? I know we can do this with SQL queries by adding the variables like {MyVariable} in the query, but it doesnt seem to work for JSON datasource URLs. Is there an event I can tap into that occurs after variable values have been selected, but before the datasources are loaded so that I could modify the json datasource path value?
