Web Query Custom Response Parsers
A Web Query Dataset sends a request to a Web Datasource and turns the response into rows. When the response is not already a flat array of records, choose Custom Script as the response parser and write JavaScript that shapes it (see Creating a Web Query Dataset).
A custom response parser runs once for every response, with these available:
| Name | What it does |
|---|---|
response | The response being processed: its data, status, headers, and the config of the request that produced it. |
push() | Adds records to the Dataset. An array adds one record per element; anything else adds a single record. |
next() | Schedules another request from a request config, such as the next page of results. |
isFirstResponse() | Returns true only while the parser handles the response to the first request. |
$local | An object that keeps its values from one response to the next. |
_ and moment | The same lodash 3 and Moment.js libraries as other Informer scripts. |
In this section
| Article | In one line |
|---|---|
| Using the next() function | Send a follow-up request from the parser, the building block for the rest of this section. |
| Handling Pagination in Web Queries | Keep requesting pages until the API says there are no more. |
| Automating Token Retrieval in Web Queries | Request a short-lived access token, then use it in the data request. |
| Unioning Two Informer Datasets Using a Web Query and the Informer REST API | Combine several Datasets into one by reading them through Informer's own API. |