Question

HTTP response body from JSON to CSV


What I'm trying to do, is to convert a JSON response form a HTTP caller to a standard table format (Excel or CSV). The issue is how do I tell FME that I want the specific keys as column headers?


2 replies

Userlevel 4

If the JSON schema is known then you can use the JSONFlattener and send it to an Excel writer where the defined structure matches the JSON schema.

If the JSON schema is unknown, you can use the JSONFlattener followed by a SchemaSetter and an Excel writer in dynamic mode.

If the JSON schema is known then you can use the JSONFlattener and send it to an Excel writer where the defined structure matches the JSON schema.

If the JSON schema is unknown, you can use the JSONFlattener followed by a SchemaSetter and an Excel writer in dynamic mode.

Hi David,

I'm using the schema set by the google analytics api v4

so the schema looks like this:

{

"reports": [

{

"columnHeader": {

"dimensions": [

"ga:pagePath"

],

"metricHeader": {

"metricHeaderEntries": [

{

"name": "ga:sessions",

"type": "INTEGER"

}

]

}

},

"data": {

"rows": [

{

"dimensions": [

"/]"

],

"metrics": [

{

"values": [

"1"

]

}

]

},

What attribute would I expose? to get a table like this:

dimensionsvalues/]1

Reply