Updated on 2025-03-24 GMT+08:00

Creating a Converter

You can use a converter to reprocess dataset data to better combine data and widget for optimal display.

Creating a Converter

  1. Log in to Huawei Cloud Astro Canvas by referring to Logging In to Huawei Cloud Astro Canvas.
  2. Choose Data Center from the main menu.
  3. Choose Converters > All in the navigation pane.
  4. (Optional) Create a folder for storing the converter.

    1. Move the cursor to All Converters, click ..., and choose New Folder.
    2. Enter a folder name and click Confirm.

      The folder name can contain 1 to 64 characters, including letters, digits, and underscores (_), but cannot start or end with an underscore (_).

  5. On the Converters page, click Create.
  6. Enter a converter name, select a folder for storing the converter, and click Confirm.

    The name contains 1 to 32 characters, including letters, digits, and underscores (_).

  7. Set converter parameters.

    Figure 1 Entering test data
    Figure 2 Result preview - Table
    Figure 3 Result preview - JSON
    • function filter(dataset) {}: data processing code in the converter. For example, if you enter the following information, the data of the subobject result in result in the data to be processed is obtained.
      return dataset.result.result
    • Test data: validation input data processed by the converter. You can enter the data or use a dataset. After entering the test data, click Test to test the data.

      For example, click Enter, enter the following example, and click Test. The results shown in Figure 2 and Figure 3 are displayed.

      {
          "resCode": "0",
          "resMsg": "Success",
          "result": {
              "result": [{
                      "disabled": false,
                      "value": "City 1"
                  },
                  {
                      "disabled": false,
                      "value": "City 2"
                  },
                  {
                      "disabled": false,
                      "value": "City 3"
                  },
                  {
                      "disabled": true,
                      "value": "City 4"
                  }
              ]
          }
      }
    • Result preview (Table/JSON): After the converter processes the test data, the final result is displayed.

  8. Click Save. The converter is created.