Skip to main content
Newcomer
Jan 17, 2022 11:15 AM UTC
Solved

Parameters in GridView.

I am trying to create a dashboard with GridView as the component. In Gridview am using Dataadapter (SQL Query). I want to pass parameter to the GridView when displaying the data in the dashboard.

Can someone help me on this.

 

Thanks & Regards,

Madesh K

ChristianW
Employee - Advisor
Jan 17, 2022 3:02 PM UTC

Hi Christian, i have tried the same in GridView but its not working. Is there any KB article for this to go-through.


Sorry I thought, the gridview is the triggering object, but you are looking for a way to change the query using a parameter.

If you have a sql data adapter, you can use the parameters in the sql script like here:

ChristianW_0-1642431226969.png

I hope, this is what you are looking for?

In the sample, Onestream replaces

|!WFProfileCriteria_TCR!|

with the parameter's value:

= 'Houston.Register'

and executes the query with this where statement:

... WHERE XFW_TCR_Register.WFProfileName = 'Houston.Register'  ...

11 replies

ChristianW
Employee - Advisor
Employee - Advisor
Jan 17, 2022 12:24 PM UTC

There is a Bound Parameter option in the sql table editor:

ChristianW_0-1642422139285.png

and an Column name for bound parameter option to define the column of the  table, that will populate the parameter:

ChristianW_1-1642422228362.png

You only can populate the parameter with one column only.

MadeshAuthor
Newcomer
Jan 17, 2022 1:42 PM UTC

Thanks Christian. 
Hope this option is available when using SQL table editor. Is there any option available in GridView?

ChristianW
Employee - Advisor
Employee - Advisor
Jan 17, 2022 1:45 PM UTC

yes, these options are in sql table editor and in grid view. The screenshots are from a sql table editor.

Member
Jan 17, 2022 4:03 PM UTC

It is better to use a Dashboard data set rule when trying to pass parameters into a SQL query. What Christian suggested will work. However, if the parameter is not resolved, this can create errors. Where in which the rule, you can check whether the parameter containssubvars and trigger the SQL or return an empty datatable.

MadeshAuthor
Newcomer
Jan 18, 2022 6:56 AM UTC

Thank you!
Yes i agree your point. I will apply this in my dashboard.