![](/img/trans.png)
[英]Google Data Studio - Custom Connector - Get Data parsing json
[英]Data Studio Custom Connector wrong amount of fields
Data Studio 自定義連接器的新功能。 我已經能夠正確地學習教程,但是在做任何更高級的事情時遇到了麻煩。 以下是我的 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
]
}
]
}
您會注意到架構中的字段數 - 8 - 與數據行中的字段數相匹配。
此外,所有 8 個字段在 Data Studio 中都顯示良好。 但是當我嘗試通過將圖表或記分卡放入 DS 中來實際使用統計信息時,我得到以下信息:
系統錯誤 Data Studio 遇到系統錯誤。
從社區連接器返回的數據中收到的列數與 Data Studio 請求的列數不匹配。 如果此問題仍然存在,請將此問題報告給此社區連接器的提供商。
有什么明顯的我在這里錯了嗎?
提前致謝。
我在這里的誤解是普遍的。 當我 select 來自 Data Studio 的單個或多個字段時,只需為適用的字段調用 getData(),這些字段通過 request.fields 參數發送。 然后它需要返回過濾掉的架構和過濾掉的行數據。
看到教程里面字段有一些過濾,只是沒有把兩個和兩個放在一起。 我本以為 DS 會足夠聰明,可以接收所有數據,然后過濾出它需要的數據,但它不是這樣工作的。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.