Forum Discussion

Madesh's avatar
Madesh
New Contributor III
3 years ago

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

  • 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:

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

  • 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's avatar
      Madesh
      New Contributor III

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

  • ChristianW's avatar
    ChristianW
    Valued Contributor

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

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

    You only can populate the parameter with one column only.

    • Madesh's avatar
      Madesh
      New Contributor III

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

      • ChristianW's avatar
        ChristianW
        Valued Contributor

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

    • IB's avatar
      IB
      New Contributor

      Hello,

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

       

      Thanks.

      Indu

    • IB's avatar
      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's avatar
        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.