Extract report results with CloudConnect

269 Views Asked by At

I would like to extract raw report results within the CloudConnect process.

So far I have managed to get response from the raw report API end point - https://secure.gooddata.com/gdc/app/projects/{project_id}/execute/raw/

This response contains URI to the file and if I put that URI to browser, file is uploaded.

I have tried passing this URI to the following readers without success:

  • CSV Reader produces the following error:

------------------- Error details ------------------

Component [CSV Reader:CSV_READER] finished with status ERROR.
Parsing error: Unexpected end of file in record 1, field 1 ("date"), metadata "outOfStock"; value: Raw record data is not available, please turn on verbose mode.

  • File Download - I don't know how to pass the URI through the port to "URL to Downlaod" parameter.
  • HTTP Connector again I don't see how to pass URI from the port.

What is the way to do this?

EDIT

If I use the HTTP Connector as suggested by @Filip, I get the following error:

Error details:
Component [HTTP connector:HTTP_CONNECTOR] finished with status ERROR. hostname in certificate didn't match: xxx.com != secure.gooddata.com OR secure.gooddata.com

I have tried setting header to X-GDC-CHECK-DOMAIN: false with no effect.

2

There are 2 best solutions below

0
On BEST ANSWER

Solution from GoodData support:

HTTP connector can be also used, but it is very complex, because logging in to GoodData has to be created. REST connector has it built in.

If you want to run the example graph, you have to be logged in in CloudConnect with a user who has access to the project from where you would like to export the report. You also have to change URL to the one of white-labeled account in both REST connector components and change project and report definition in the first REST connector.

So the graph that works looks like this:

Graph that loads report

Here are the main fields that you will need to set for each element:

  1. Get Results URI - set params for POST request:

Request URL = https://secure.gooddata.com/gdc/app/projects/${GDC_PROJECT_ID}/execute/raw/

Request Body = { "report_req": { "reportDefinition": "gdc/md/${GDC_PROJECT_ID}/obj/${OBJECT_ID}" } }

  1. Get URI from Response - just map uri value to corresponding field:

    <Mapping cloverField="uri" xpath="uri"/>

  2. Load Results - make sure it is connected to metadata with two fields, one for response with data, other to pass through the uri.

  3. Load Results - you will need to exclude uri field to process the data:

Exclude Fields = uri

0
On

The HTTP connector is the right component to go with. Leave the URL property empty and use the component’s property called “Input mapping”, where in the graphic editor you can assign the input edge field to the URL field.