.dataset().data()

.dataset(...).data(): Dictionary

Get the data for a given dataset.

Parameters

  • N/A

Returns

This method returns a dictionary containing a data array or an error message. This array will hold one entry for each row in your data set, the exact structure of which will depend upon how your data set is configured, and any data sets which are linked to it. The properties in the row objects are named based upon their data point ids. The prefix for the id can help identify what type it is:

  • dp- - regular data point
  • c- - computed value
  • l- - link (which will be an array of objects, in a similar structure, based upon the link).

Each row object will also have the following properties:

  • id - The identifier for that row
  • dv - The data version of the row. Each edit will increment this value by one.
  • color - The row color as a hex string.

The API will return the value of all data points that the role(s) have access to, regardless of the visibility of the data points in the table CloudTables creates.

To understand the structure of the JSON representation for each row, please use the .dataset().schema() method.

If the data is requested for a data set which does not exist, the JSON return will contain an error property with an error message.

{
	"data": [
		{
			"id": number,
			"dv": number,
			// ... data values
		}
	],
	"error": string // If no error, then undefined
}

Example

The following shows the an example call to get the data from a flight information CloudTable which contains dp-11 the flight number, l-5 a link to an airports data set for the departure airport and l-6 for the link to the arrivals airport. Inside these two lines dp-8 is the airport name.

api = CloudTablesApi(':apiKey', subdomain='sub-domain')
result = api.dataset(':id').data()

The resulting JSON structure is:

{
	"data": [{
		"id": 13,
		"dv": 1,
		"dp-11": "AA123",
		"l-5": [{
			"id": 2,
			"dp-8": "Edinburgh"
		}],
		"l-6": [{
			"id": 3,
			"dp-8": "Bristol"
		}]
	}, {
		"id": 14,
		"dv": 0,
		"dp-11": "AA234",
		"l-5": [{
			"id": 5,
			"dp-8": "Heathrow"
		}],
		"l-6": [{
			"id": 4,
			"dp-8": "San Francisco"
		}]
	}]
}