All Products
Search
Document Center

DataV:Configure callback IDs for ticker boards

Last Updated:Apr 18, 2024

In DataV, a callback ID is a parameter that is passed to other assets when an asset responds to a user operation or automatically triggers an update. This parameter can be used as a dynamic variable during data query in other assets. This topic uses a ticker board widget as an example to demonstrate the use of callback IDs.

Procedure

  1. Log on DataV console.

  2. Select a visualization application and click Edit to go to the Canvas Editor page.

  3. Add the TicketCard Maker and Title widgets to the canvas.

  4. Select the ticker board component and click the Interactive tab on the right side of the editor.

    Note

    DataV provides an independent editing area for the callback ID, which is the Interactive panel in the preceding figure. This allows you to use the callback ID feature clearly and quickly.

  5. Select Enable next to Current Value Change. Modify the name of a variable that is bound to the variable.

    Note
    • After the variable name is changed to income, the income can be used to obtain the parameter value in the asset that needs to respond to the callback ID.

    • You can set different variable names for different assets to distinguish between different parameters.

  6. Click the asset whose callback ID you want to respond to. In the data source edit box on the Data page, set: Variable name to the variable that you have configured. For example, you can set the :income parameter. The Title widget is used as an example.

    Note

    If the Data Source Type parameter is set to Static Data or CSV File, the callback ID is not supported.

    • SQL mode

      select :income as value
      select city from test_id_3 where id = :income
      Note
      • income is the callback ID that you configured, value is a custom field that receives the value of the callback ID.

      • The id and city are the fields in your database, and the test_id_3 is the table name of the data table in the database.

    • API mode

      https://api.test?id=:income&city=:mycity
      Note

      The income and mycity are the callback IDs that you configured, and the id and city are the fields in your database.

Advanced features

Set custom fields

  1. Select the ticker board widget and click the Data tab.

  2. Click Configure Data Source.

  3. Add a id field to the static data with a value of 123.

  4. On the Interaction tab, click Create Field.

  5. In the Field column, enter id. In the Bound Variable column, enter a variable name.

    Note

    This variable takes effect only after you specify both the field value and the value of the Bind to Variable parameter.

Set the default value of the callback ID

Specify a request parameter in the URL to set a default value for the callback ID. Example:

http://datav.aliyun.com/screen/000000?myid=123

000000 is the project ID. When you access the visualization application through this URL, the value of the myid of the callback ID has been set to 123 at the same time when the page is opened. Multiple callback IDs are connected by ampersand (&). In the following example, both the myid of callback IDs and the default value of income are set.

http://datav.aliyun.com/screen/000000?myid=123&income=1000

000000 is the project ID.

FAQ

Q: What can I do if I cannot obtain the callback value after I configure the callback ID on the canvas edit page and the data query fails?

A: The canvas editing page cannot trigger the event and obtain the callback value. Therefore, the request fails. You can use one of the following methods to view the return value of the request.

  • Preview the project. View the return value of the request in the browser console Network, or directly through the asset display mode.

  • Edit the project. Add test parameters next to the URL of the visual application to test the data.

    https://datav.aliyun.com/admin/screen/99999? parameter name=parameter value