I'm using the step "REST Client" to call a web service that returns the initial data in json format.
The number of the returned records is limited to 50.
Therefore I have to read the nested property "nextPage" within the json object to have access to the next 50 records.
I tried to work with a XMLHttpRequest in Javascript but it failed with the following log message "ReferenceError: "XMLHttpRequest" is not defined".
So how can I do a XMLHttpRequest within Pentaho Data Integration?
Or is there any other way to follow nested links within a json stream?
The number of the returned records is limited to 50.
Code:
{
- "metadata": {
- "recordsTotal": 2324,
- "pagesTotal": 47,
- "recordsPerPage": 50,
- "currentPage": 1,
- "links": {
}
}, - "records": [
- {}
I tried to work with a XMLHttpRequest in Javascript but it failed with the following log message "ReferenceError: "XMLHttpRequest" is not defined".
Code:
var jsonObject = JSON.parse(jsonAllJobsStream.getString());
var nextPage = jsonObject.metadata.links.nextPage;
var xmlhttp = new XMLHttpRequest();
Or is there any other way to follow nested links within a json stream?