6

When I try to explore my data source fetched by a custom connector, I encounter a System error: 593d1fe0.

The number of columns received in the data returned from the community connector does not match the number of columns requested by Data Studio

But When I'm debugging my getData function, the result contains the same columns and same number of columns.

What can cause this kind of troubles ? some screenshots of the debug view:

the schema

the data (rows)

Is my output structure correct ? is there something to consider regarding column names ?

Minhaz Kazi
  • 3,115
  • 1
  • 10
  • 20

1 Answers1

6

Data Studio does not request all the possible fields from getData function. Most of the times, Data Studio will request a small subset from available fields. The list of required fields will be passed in the request object when the getData call is made.

See getData reference doc to understand the structure of request and fields.

Your getData response should not return all available fields. Rather, the response should return only the requested fields. See example code showing how you can filter the fields.

For additional help, you can try the official codelab - Step 10 is relevant to your question. You can also view more examples at the official Data Studio Open Source repo.

Minhaz Kazi
  • 3,115
  • 1
  • 10
  • 20
  • Hi @minhaz-kazi! Thank you for your help and tutorials. Doesn't this process slow down the execution? When `getData` takes only some of the required fields, it certainly should return to the function multiple times and refer to the API or source multiple times. – Max Makhrov Jun 09 '20 at 04:02
  • 1
    Most welcome! The execution timing will actually depend on the elements on your dashboard. e.g. if your schema has 60 fields and your dashboard has only one element with 2 fields, execution might actually be faster. This type of design also allows connectors to have a schema catering multiple endpoint instead of just one single instance of tabular data. A good example of this is the native Google Analytics connector. Furthermore, if you API supports filtering and aggregation, you will also get gains there. – Minhaz Kazi Jun 09 '20 at 19:29