Parameters in GridView.

Madesh
New Contributor III

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

1 ACCEPTED SOLUTION

ChristianW
Valued Contributor

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'  ...

View solution in original post

11 REPLIES 11

ChristianW
Valued Contributor

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.

Madesh
New Contributor III

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

ChristianW
Valued Contributor

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

Madesh
New Contributor III

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

ChristianW
Valued Contributor

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'  ...

Madesh
New Contributor III

Hi Christian,

Thank you so much. Yes, i was looking for the same. I applied the same in my query and it worked.

Thanks & Regards,

Madesh K

IB
New Contributor

Hello,

Is it possible to tie this to a supplied parameter as a delimited list?

 

Thanks.

Indu

IB
New Contributor

Hi Christian,

I have a problem passing parameters with Multiselect=True. I want a list of the column to be passed to process a sql in the BR. Any help would be appreciated.

Thank You,

Indu

ChristianW
Valued Contributor

Did you encapsulate the parameter with brackets?

param = [|!MyParameter!|]

This is needed to prevent the business rule call from misinterpreting the commas in the comma-separated list.

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.

Madesh
New Contributor III

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