new CloudTables.Condition()

This class is used to create conditions to apply to data being fetched. Please see the embedding conditions documentation for full details.

Constructors

Creates a new condition instance which can be applied to a data access request, limiting the data that will be returned by the server.

new Condition()
new Condition(string id, string value)
  • Namespace: CloudTables
  • Parameters:
    1. string - The id of the data point the condition should be applied to.
    2. string - The value to use.

Methods

  • Id(string id) Condition
    Set the id of the data point to perform the condition on. The ids can be found from your data set's Data page and click on the item in question. The id will be shown in the item inspector on the right. It will start dp- for a regular data point. Conditions on computed values (c-) and links (l-) are not currently supported.
  • Name(string name) Condition
    Set the name of the data point to perform the condition on. This can be given as an alternative to the id option as it is easier to remember. However, while the id is static, the name can be changed in the application.
  • Op(string op) Condition
    Set the conditional operator, which may be one of =, !=, <, <=, >=, >.
  • Set(bool set) Condition
    Mark the value to be set (default) or not when creating a new row. When a new record is created, the API can set the data point to a specific value (defined by setValue or value if the former is not specified).
  • SetValue(string setValue) Condition
    The value that will be written to the database if Set is enabled. Note that Value will be used by default, and this method can override it with a new value to be set. It must be specified if Op is not set to =.
  • Value(string value) Condition
    The value that will be used for the conditional matching, and for writing to new records, unless SetValue is specified. The formatting must follow these rules:
    • date - ISO 8601 (date only)
    • datetime - ISO 8601
    • number - Unformatted number
    • text - Plain text
    • time - ISO 8601 (time only).

Example

var api = new CloudTables.Api("sub-domain", ":apiKey");

api.Condition(new Condition("dp-19", "Angela"));

var result = await api.Dataset(":id").Data();
// Results in only data being fetched where `dp-19` == `Angela`