反馈已提交

网络繁忙

You are viewing 5.1 help doc. More details are displayed in the latest help doc.

[Direct] Add parameters to the dashboard URL directly

  • Recent Updates: April 25, 2022
  • 1.Overview

    1.1 Version

    FineBI VersionFunction Changes
    5.1-
    5.1.5Canceling the "Real-time Data" button, FineBI provides BI projects with two calculation modes: "Real-time Data" and "Extracted Data" to avoid problems caused by the mixed use of real-time data and extracted data.
    5.1.6When the URL parameter and the filtering component SQL parameter exist at the same time, the URL parameter takes precedence when the user refreshes the dashboard, such as redirecting, or refreshing the browser directly, directly copying the link to open, etc.

    Subsequent operations on the redirected dashboard interface to change the parameters, the filter component parameters take effect.

    1.2 Problem description

    In the integrated environment, users need to directly add relevant parameters when opening the relevant dashboard URL of the store, such as  

    http://xxxxxxxx&COUNTRY=China (version before 5.1.11); http://xxxxxxxx? COUNTRY=China (5.1.11 and later versions) filter out the data whose "COUNTRY" is "China".

    1.3 Implementation ideas

    Add parameters to the SQL dataset.

    Directly add parameter conditions in the front-end dashboard to realize the data filtering function.

    If you need to pass parameters through the filter component, see: filter component as a parameter to participate in calculation, jump to filter component to pass parameters.

    2. Pass a parameter

    2.1 Add SQL dataset

    Create a new SQL data set with parameters in the business package:

    SELECT * FROM CUSTOMER WHERE COUNTRY IN ('${COUNTRY}'). ${COUNTRY} is the parameter variable to be set, click "Refresh", set the default value of the parameter as "China", set the parameter type to text type, click "Preview", and confirm to save the dataset, as shown in the figure below :

    1.png

    2.2 Create Dashboard

    Create a new dashboard, select the created SQL data table "customerinfo" with parameters, drag in the "COUNTRY" and "Counter" fields, and select "group table", as shown in the following figure:

    2.png

    2.3 Passing parameters

    Link TypePassing One Value Writing MethodPassing Multiple Values Writing Method
    Public links before version 5.1.11&parameter name=parameter value&parameter name=parameter value 1','parameter value 2
    Public links after version 5.1.11?Parameter name = parameter value?Parameter name = parameter value 1',' parameter value 2
    Preview link?parameter name=parameter value?parameter name=parameter value 1','parameter value 2

    2.3.1 Public link passing parameters

    To implement the parameter passing filter in the URL, you first need to obtain the URL of the dashboard. Enter the dashboard node, select "Share Link" for the newly created dashboard, open the public link and "Copy Link", as shown in the following figure:3.png

    Add "&parameter name=parameter value" after the obtained URL

    Before version 5.1.11, for example, the obtained link is:

    http://localhost:37799/webroot/decision/v5/design/report/share/085cfd6b620c441eae930b9ad709e717?link=eyJhbGciOiJIUzI1NiJ9.eyJyZXBvcnRJZCI6IjA4NWNmZDZiNjIwYzQ0MWVhZTkzMGI5YWQ3MDllNzE3IiwidXNlcklkIjoiYjVmMGMyZWUtNjQwZi00MDM5LWE0ZDQtOTE4YjU1MzU0ODk4IiwianRpIjoiand0In0.19qCbrS1Mlpr9unY30Sk02p4Y1PbS1fv2xIAu3VfMBk

    Add "&COUNTRY=China" at the end:

    http://localhost:37799/webroot/decision/v5/design/report/share/085cfd6b620c441eae930b9ad709e717?link=eyJhbGciOiJIUzI1NiJ9.eyJyZXBvcnRJZCI6IjA4NWNmZDZiNjIwYzQ0MWVhZTkzMGI5YWQ3MDllNzE3IiwidXNlcklkIjoiYjVmMGMyZWUtNjQwZi00MDM5LWE0ZDQtOTE4YjU1MzU0ODk4IiwianRpIjoiand0In0.19qCbrS1Mlpr9unY30Sk02p4Y1PbS1fv2xIAu3VfMBk&COUNTRY=China

    Enter the URL with added parameters in the address bar, and you can see that the parameters in the URL are passed to achieve the filtering of "Management Store", as shown in the following figure:4-副本副本.png

    Note: If the browser does not support Chinese parameters, that is, the parameter transmission filter does not take effect, you need to encode the json type url parameter value first encodeURIComponent(). For example, the edge browser.

    After version 5.1.11, for example, the obtained link is: http://localhost:37799/webroot/decision/link/3Oth.

    Add "?COUNTRY=China" at the end: http://localhost:37799/webroot/decision/link/3Oth?COUNTRY=China.

    Enter the URL with added parameters in the address bar, and you can see that the parameters in the URL are passed to achieve the filtering of the "China".

    2.3.2 Preview link passing parameters

    Add "? parameter name=parameter value" to the URL of the dashboard preview, and you can also pass parameters.

    For example, click "Preview Dashboard" to get the preview URL, as shown in the figure below:5.png

    Add "?COUNTRY=China" after the preview URL, you can see that the data of the country China is filtered out in the group table below, and the parameter transfer function is realized, as shown in the following figure:6.png

    3. Pass multiple parameters

    When there are multiple parameters, the URL can also add parameters to achieve the effect of multiple condition filtering.

    3.1 Add SQL dataset with multiple parameters

    Add a SQL dataset, and enter a SQL statement with multiple parameters:

    select* from CUSTOMER where COUNTRY in ('${COUNTRY}') and CITY in ('${CITY}')

    Click "Refresh", set the default values to "China" and "Wu Xi", and save the dataset, as shown in the figure below:7.png

    3.2 Create Dashboard

    Use the fields of the data table to create a component, including the "COUNTRY", "CITY", and "Counter" fields. The field values displayed in the component are all parameter default values. As shown below:8.png

    3.3 Passing parameters

    Refer to section 2.3 to obtain the link of the dashboard, and add multiple parameters and values after the obtained URL:

    Link TypePass Parameter Writing
    Public links before version 5.1.11
    &Parameter name1=Parameter value1&Parameter name2=Parameter value2
    Public link after version 5.1.11?Parameter name1=Parameter value1&Parameter name2=Parameter value2
    Preview link?Parameter name1=Parameter value1&Parameter name2=Parameter value2

    For example, the obtained preview URL is:

    http://localhost:37799/webroot/decision/v5/design/report/4c2c026273b74106be5def55a58ea067/view

    Add the parameter "?COUNTRY=China&CITY=Wu Xi", and the URL after adding the parameter is:

    http://localhost:37799/webroot/decision/v5/design/report/4c2c026273b74106be5def55a58ea067/view?COUNTRY=China&CITY=Wu Xi

    After adding parameters, the dashboard can directly filter out the corresponding parameter values, as shown in the following figure:9.png

    Attachment List


    Theme: Build Charts and Analyze data
    Already the First
    Already the Last
    • Helpful
    • Not helpful
    • Only read

    售前咨询电话

    400-811-8890转1

    在线技术支持

    在线QQ:800049425

    热线电话:400-811-8890转2

    总裁办24H投诉

    热线电话:173-1278-1526

    文 档反 馈

    鼠标选中内容,快速反馈问题

    鼠标选中存在疑惑的内容,即可快速反馈问题,我们将会跟进处理。

    不再提示

    10s后关闭