Skip to main content
Question

HTTP response body from JSON to CSV

  • May 9, 2019
  • 2 replies
  • 116 views

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?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

david_r
Celebrity
  • May 9, 2019

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.


  • Author
  • May 9, 2019

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