Template value in workspace chart query

Feature(s) impacted

Workspace chart which use query.

Observed behavior

Cannot save when trying to use a template variable in the workspace chart query editor.

Expected behavior

A query using a template variable can be saved and the chart is rendered.

Failure Logs

Context

  • Project name: …
  • Team name: …
  • Environment name: …
  • Agent (forest package) name & version: forest-express-sequelize 9.2.10
  • Database type: MySQL
  • Recent changes made on your end if any: Just upgraded to forest-express-sequelize 9.2.10 and started trying the workspace chart feature, so I haven’t yet seen the expected behavior.

I’m trying to draw a chart based on a selected row in a collection in the workspace,
hoping to do the same that is described here Building a workspace - User Guide .

The save button doesn’t become enabled when I have the {{ ... }} in the query.

The query I’m trying to use is something like:

SELECT a 'key', price as 'value'
FROM prices where
day = {{search.selectedRow.day}} and area = 3;

Hello @mash

Thank you for posting

I can reproduce this bug on my side, we’ll keep you updated when the fix will be released

Maybe you can use a simple chart and add a filter with a template variable as a workaround

1 Like

Hi @mash ,

This behaviour is intended as we do not know the format of the date. For now, only string fields are allowed in the query templating.
I will push that into the ProductBoard for a feature request.

Best regards,

Shohan

Could I have your project name to add more data to the feedback ?