简体   繁体   English

Data Studio 自定义连接器字段数量错误

[英]Data Studio Custom Connector wrong amount of fields

New to Data Studio Custom connectors. Data Studio 自定义连接器的新功能。 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:以下是我的 getData() function 返回的内容:

{
  "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.您会注意到架构中的字段数 - 8 - 与数据行中的字段数相匹配。

In addition, all 8 of the fields show up fine in Data Studio.此外,所有 8 个字段在 Data Studio 中都显示良好。 But when I try to actually use a stat by placing a graph or Scorecard into DS, I get the following:但是当我尝试通过将图表或记分卡放入 DS 中来实际使用统计信息时,我得到以下信息:

System Error Data Studio has encountered a system error.系统错误 Data Studio 遇到系统错误。

The number of columns received in the data returned from the community connector does not match the number of columns requested by Data Studio.从社区连接器返回的数据中收到的列数与 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.当我 select 来自 Data Studio 的单个或多个字段时,只需为适用的字段调用 getData(),这些字段通过 request.fields 参数发送。 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.我本以为 DS 会足够聪明,可以接收所有数据,然后过滤出它需要的数据,但它不是这样工作的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google Data Studio - 自定义连接器 - 获取数据解析 json - Google Data Studio - Custom Connector - Get Data parsing json 在 DataStudio 的自定义连接器中过滤数据 - Filtering data in custom connector for DataStudio 自己的连接器的自定义数据新鲜度选项 - Custom data freshness options for own connector Google Data Studio 社区连接器:在 App 脚本中访问 URL 参数 - Google Data Studio Community Connector: Accessing URL Parameters in App Script Data Studio Community Connector:如何更改数据新鲜度间隔 - Data Studio Community Connector: How to change Data freshness interval Data Studio - 计算字段 - 减去总事件 - Data Studio - Calculate Fields - Substraction of Total Events 如何使用 Data Studio 中的 BigQuery 连接器向参数添加“允许值”列表? - How to add a list of "permitted values" to a parameter by using a BigQuery connector in Data Studio? 如何使用用户可以在 getFields 的计算字段中更新的参数(Data Studio 社区连接器) - How to use a parameter which a user can update in a calculated field in getFields (Data Studio Community Connector) 将 Google Data Studio 社区连接器与 BigQuery 结合使用时的时间戳查询问题 - Timestamp query issue when using Google Data Studio community connector with BigQuery 如何在 Google Data Studio 中用新行连接两个字段? - How to concat two fields with a new line in the middle in Google Data Studio?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM