I have a variable obtained by query component, I want to pass it to a query on Data sources that will be used by another query component, here is what I did:
1) DataSources - sql_company_id :
2) first Query Component :
With a JS function on Post Fetch:
function f(company_id) {
dashboard.setParam('company_id', company_id.resultset);
}
So company_id=1 in my example.
3) DataSources - sql_company_name
with parameter defined like below:
4) second Query Component :
with Post Fetch like this:
It is supposed to display the company name having company_id='1' but nothing appears.
When I change the second query to:
select company_name
from company
where company_id=1;
Then it works.
I'm not using correctly the variable {company_id} I suppose. I had a very similar prob and got the solution so I did in the same way this time. Where I got wrong?