简体   繁体   中英

Data Studio Custom Connector wrong amount of fields

New to Data Studio Custom connectors. I've been able to get the tutorials right, but having trouble when doing anything more advanced. The following is what my getData() function returns:

{
  "schema": [
    {
      "semantics": {
        "semanticType": "TEXT",
        "conceptType": "DIMENSION"
      },
      "name": "Series",
      "dataType": "STRING",
      "label": "Series"
    },
    {
      "name": "$overall",
      "dataType": "NUMBER",
      "semantics": {
        "conceptType": "METRIC",
        "semanticType": "NUMBER",
        "isReaggregatable": true
      },
      "defaultAggregationType": "SUM"
    },
    {
      "name": "undefined",
      "defaultAggregationType": "SUM",
      "semantics": {
        "isReaggregatable": true,
        "semanticType": "NUMBER",
        "conceptType": "METRIC"
      },
      "dataType": "NUMBER"
    },
    {
      "dataType": "NUMBER",
      "defaultAggregationType": "SUM",
      "semantics": {
        "isReaggregatable": true,
        "conceptType": "METRIC",
        "semanticType": "NUMBER"
      },
      "name": "Student"
    },
    {
      "semantics": {
        "semanticType": "NUMBER",
        "isReaggregatable": true,
        "conceptType": "METRIC"
      },
      "name": "Teacher",
      "defaultAggregationType": "SUM",
      "dataType": "NUMBER"
    },
    {
      "defaultAggregationType": "SUM",
      "semantics": {
        "conceptType": "METRIC",
        "isReaggregatable": true,
        "semanticType": "NUMBER"
      },
      "name": "Principal",
      "dataType": "NUMBER"
    },
    {
      "dataType": "NUMBER",
      "defaultAggregationType": "SUM",
      "semantics": {
        "semanticType": "NUMBER",
        "conceptType": "METRIC",
        "isReaggregatable": true
      },
      "name": "Assistant"
    },
    {
      "dataType": "NUMBER",
      "semantics": {
        "conceptType": "METRIC",
        "semanticType": "NUMBER",
        "isReaggregatable": true
      },
      "name": "Staff",
      "defaultAggregationType": "SUM"
    }
  ],
  "rows": [
    {
      "values": [
        "All Events - Unique",
        1338,
        1137,
        987,
        112,
        10,
        9,
        1
      ]
    }
  ]
}

You'll notice the number of fields in the schema - 8 - matches the number of fields in the data row.

In addition, all 8 of the fields show up fine in Data Studio. But when I try to actually use a stat by placing a graph or Scorecard into DS, I get the following:

System Error Data Studio has encountered a system error.

The number of columns received in the data returned from the community connector does not match the number of columns requested by Data Studio. Please report the issue to the provider of this community connector if this issue persists.

Anything obvious that I have wrong here?

Thanks in advance.

My misunderstanding here was a general one. When I select a single or multiple fields from Data Studio, getData() needs to be called for just the applicable fields , which are sent through in the request.fields parameter. It needs to then return the filtered out schema and the filtered out row data.

I saw that the fields had some filtering in the tutorial, and just didn't put two and two together. I would have thought DS would have been smart enough to receive all the data, and then filter out what it needed, but that's not the way it works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM