This article describes data source functionality in the Grid Custom Field.
You can connect the grid to an external data source, located on a remote web-service and reuse a connection in multiple grids.
The Data source type is REST. We support only JSON for processing data.
You can access remote REST API using data sources in the Grid Custom Field.
Data source configuration
You can add a Data source under the Data Sources tab in the grid configuration dahsboard.
Available fields:
Name - a name of your data source connection
Description - optional description of the data source for your reference. It will be displayed below the title in the Data source list.
URL - URL address of the web service you want to connect to the grid.
Path - the path to JSON array. You can specify it when loading a specific array from the JSON.
Headers - allows adding header fields. You can use them in case the data source requires HTTP authentication.
You can test a connection to the data source using a Test Connection button.
The data loads in a preview and you can check if it's correct.
Path to JSON array
You can specify the direct path to an array inside the JSON with the help of JSONPath expressions. Data may be found and extracted out of JSON structures.
JSONPath expressions always refer to a JSON structure. A JSON structure is usually anonymous and doesn't have a "root member object". Thus the JSONPath assumes the abstract name $
assigned to the outer level object.
JSONPath expressions can use the dot–notation
$.store.book[0].title
Overview of the JSONPath syntax elements
JSONPath | Description |
$ | the root object/element |
@ | the current object/element |
. or [] | child operator |
n/a | parent |
* | wildcard. All objects/elements regardless their names. |
[] | subscript operator. In JSON it is the native array operator. |
?() | applies a filter (script) expression. |
() | script expression, using the underlying script engine. |
JSONPath square brackets operate on the object or array addressed by the previous path fragment. Indices always start by 0.