In DataV, the asset interaction configuration and callback ID configuration are the parameters that an asset passes to other assets when it responds to user actions or automatically triggers updates. This parameter can be used as a dynamic variable in other assets when data is queried. This topic uses the ticker board widget as an example to describe the asset interaction configuration feature of DataV.

Procedure

  1. Click the ticker board widget, and then click the Interaction tab on the right-side panel.Interaction panel
    Note You can configure callback IDs on the Interaction tab on the right-side panel.
  2. Select the Enable check box to the right of Trigger Event when Number Changed.
  3. In the Bound Variable column, change the variable name from value to income.
    Change the variable name
    Note
    • After you change the variable name to income, you can use income to obtain the parameter value in another widget that calls the callback ID of this widget.
    • You can configure different variable names in different widgets to differentiate parameters.
  4. Click the ticker board widget. On the Data tab on the right-side panel, click Modify next to Data Source and use the callback ID that you have configured in the format of :Variable name, for example, :income.

    Examples:

    • SQL (Use one of the following two methods.)
      select :income as value
      select A from table where count = :income

      income is the callback ID, value is the field you specified to receive the value of the callback ID, and count and A are the fields in your database.

    • API
      http://api.test?count=:income&id=:myid

      income and myid are the callback IDs, and count and id are the fields in your database.

    Note
    • If the data source type of your widget is Static Data or CSV File, callback IDs are not supported.
    • DataV automatically completes the callback IDs. When you configure the data source, enter :, and the editor lists callback IDs configured for the widget. You can use the up and down arrow keys to select a callback ID and then press Enter. This helps you quickly find a callback ID when there are a lot of interactive widgets in the project.
      Configure a callback ID

Advanced features

Configure a custom field
  1. Click the ticker board widget, and then click the Data tab on the right-side panel.
  2. Add an id field and set its value to 123.
    Configure a custom field
  3. Click the Interaction tab.
  4. Click Create Field.
  5. In the Field column, enter id. In the Bound Variable column, enter a variable name.
    Create a field
    Note You must specify values in both the Field and Bound Variable columns so that the variable can take effect.
Set a default value for 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 project by using this URL, the callback ID myid is automatically set to 123.

Multiple callback IDs are separated with ampersands (&). The following example sets the default values for both the callback IDs myid and income:
http://datav.aliyun.com/screen/000000?myid=123&income=1000
000000 is the project ID.