Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to automate some APIs. So I started from Google analytics one (I know that Talend has a component for it, I just want to educate myself so that I can then jump to Facebook etc)
Here is my Job:
Response from GA looks like this:
{"kind":"analytics#gaData",
"id":"",
"query":{"start-date":"2015-01-01","end-date":"2015-01-10","ids":"ga:1111111","dimensions":"ga:date,ga:medium,ga:browser","metrics":["ga:sessions","ga:bounces"],"start-index":1,"max-results":1000},"itemsPerPage":1000,"totalResults":156,"selfLink":"","profileInfo":{"profileId":"11111111","accountId":"111111","webPropertyId":"UA-1111111","internalWebPropertyId":"11111111","profileName":"aaaaaaaa","tableId":"ga:11111111"},"containsSampledData":false,"columnHeaders":[{"name":"ga:date","columnType":"DIMENSION","dataType":"STRING"},{"name":"ga:medium","columnType":"DIMENSION","dataType":"STRING"},{"name":"ga:browser","columnType":"DIMENSION","dataType":"STRING"},{"name":"ga:sessions","columnType":"METRIC","dataType":"INTEGER"},{"name":"ga:bounces","columnType":"METRIC","dataType":"INTEGER"}],"totalsForAllResults":{"ga:sessions":"907","ga:bounces":"480"},
"rows":[["20150101","(none)","Chrome","3","2"],["20150101","(none)","Safari","2","1"],["20150101","organic","Chrome","9","4"]]}
I specifically want to extract 'rows' part in columns.
I can successfully make it for the first object in the array:
But when I replace "$.rows[0][1]" to "$.rows[][1]" to iterate, I get nulls.
Any help will be appreciated.
Also. How can I save the result of my REST request into the file? tFileJSONoutput adds some weird body object and I can't read anything from the file after that. Can I save plain text into txt?
Thanks
$.rows[Asterisk][0]