Charts Workspace using {{Merchant.selectedRecord.id}} or Merchant.selectedRecord.id
Observed behavior
Error : PG::SyntaxError: ERROR: syntax error at or near “{” LINE 3: …cts.id FROM products WHERE products.merchant_id = {{Merchant… ^
Expected behavior
Show the data
Context
Workspace :
Search with on click row table merchant
Chart Single Value : Query :
SELECT COUNT(*) as value
FROM plan_sales
WHERE plan_sales.product_id IN (SELECT products.id FROM products WHERE products.merchant_id = {{Merchant.selectedRecord.id}});
How can i use the “selected record” in a Query Chart?
What you’re trying to achieve here (using templated value inside a chart query) is not possible yet
As you might know, Workspace is a pretty new feature and there are still some work to do to make them perfect!
On this specific subject, what’s coming soon is the possibility to filter using templated value on a Simple chart. Would it help you on your use case?
Thanks again for your feedback, this is priceless for us.
SELECT COUNT(*) as value
FROM plan_sales
WHERE plan_sales.product_id IN (SELECT products.id FROM products WHERE products.merchant_id = {{Merchant.selectedRecord.id}});
is now possible and should work straight away as soon as you update your forest-express-sequelize version to 9.0.0