.Dataset().Row().Update()
Task<TRowData> api
.Dataset(...)
.Row(...)
.Update(IEnumerable<KeyValuePair<string, string>>data)
Update the data for a given row with a complete or partial update.
IEnumerable
object (e.g. a List<KeyValuePair<string, string>>
or Dictionary<string, string>
) which contains properties whose names start dp-
for data points and l-
for links..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.public class TRowEditData {
public dynamic data;
public string error;
public TFieldErrors[] fieldErrors;
public bool success;
}
public class TFieldErrors {
public string name;
public string status;
}
This method returns a Task
which will resolve to an TRowEditData
instance which is largely the same as that returned by the .Dataset().Row().Data()
method with the addition of the fieldErrors
property which contains information about individual field inputs should validation of any of them fail.
Consider the following being sent to our example data set for flights, updating the row that was inserted in the .Dataset().Insert()
example:
var api = new CloudTables.Api("sub-domain", ":apiKey");
var result = await api
.Dataset(":id")
.Row(12)
.Update(new Dictionary<string, string>() {
{"dp-11", "Supersonic"}
});
As with the .Dataset().Insert()
method links can have one or multiple values depending on their configuration in CloudTables, here l-4
expects a single value while l-6
can have multiple:
var api = new CloudTables.Api("sub-domain", ":apiKey");
var result = await api
.Dataset(":id")
.Row(24)
.Insert(new Dictionary<string, string>() {
{"dp-11", "Supersonic"},
{"l-4", "12"},
{"l-6", "[9,21]"}
});