.dataset().row().update()
.dataset(...).row(...).update(data: Dictionary): Dictionary
Update the data for a given row with a complete or partial update.
dp-
for data points and l-
for links. To get the data point id's please use the .dataset().schema()
method or refer to the "ID" for the data point which can be found in the Data set inspector of the Data tab for the data set. The number of dp-{number}
parameters will depend upon the number of data points configured for the data set. Each is optional (unless a "Required" validator is set for the data point) and will take the default value if not specified.This method returns a dictionary containing a data
object with the data for the updated row, if there are no errors, in the same structure as .dataset().data()
method. Additionally, if any errors are reported there may be error
and fieldError
properties. If there are no errors, the error properties will not be present.
{
"data": {
"id": number,
"dv": number,
// ... data values
},
"error": string, // General error information
"fieldErrors": [
{
"name": string, // Name of the data point in error
"status": string // Error message
}
]
}
Consider the following being sent to our example data set for flights, updating the row that was inserted in the .dataset().insert()
example:
api = CloudTablesApi(':apiKey', subdomain='sub-domain')
result = api.dataset(':id').row(13).update({
'dp-11': 'Supersonic'
})
Will result in the following JSON being stored in result
:
{
"data": {
"id": 27,
"dv": 0,
"dp-11": "Supersonic",
"l-5": [{
"id": 11,
"dp-8": "Aberdeen"
}],
"l-6": [{
"id": 3,
"dp-8": "Bristol"
}]
}
}