ApplicationExperience

Table: Get Rows Node

The Data Table: Get Rows Node allows for querying your application’s data tables and storing the results of the query on your workflow’s payload.

Get Rows Node

Node Properties

The Data Table: Get Rows Node takes a number of parameters, most of which are optional.

Required Fields

  • Table ID Template: The table on which the query should be performed. You may select one of your application’s tables or enter a string template, which should resolve to a valid table ID.
  • Result Path: A payload path defined at the bottom of the editor for where the result of the query will be stored. This result will include the query itself, the items in the query, and some additional meta information; or, the result will include an error if the query is invalid.

Query Fields

Building your query within the node is nearly identical to building a query within the table browsing interface. The only difference is, when building a query within the node, you may use string templates for each property and value – or, if building an advanced query, you may use a JSON template.

Get Rows Query

If you selected a data table directly instead of using a template, there will be a section detailing all of the columns in the table and their data types to assist you in building your query.

The query section is optional. If you do not include any queries, all rows will be returned and then limited by the filter fields defined below. However, if you do include any piece of a query (e.g. the Property), you must also include the other two pieces (the Operator and the Value).

Query Option Fields

Optionally, you may also include some parameters for sorting, limiting and paginating the results of the query. All of these fields are templatable.

Get Rows Filter

  • Limit Template: must be a number between 1 and 1000, or a template that resolves to such a number. Default is 1000.
  • Offset Template: must be a number greater than or equal to 0, or a template that resolves to such a number. This is similar to requesting a specific page of results, except you are defining the number of records to skip instead of a page to return. Default is 0.
  • Sort By Template: is the field by which the results should be sorted. If using a template, this should resolve to one of your table’s column names or one of the default columns. Default is id.
  • Sort Direction Template: must be either asc, desc or a template that resolves to one of those values. Default is asc.
  • Fields To Include Template: allows you to control the exact columns returned for the resulting rows. By default, all columns are returned. You can restrict to specific columns by providing a comma deliminited list of column names.

Node Example

Given a result path of rowsResult, a successful row query result might look like:

{
  ...
  "rowsResult": {
    "totalCount": 8,
    "count": 2,
    "sortColumn": "id",
    "sortDirection": "asc",
    "offset": 0,
    "limit": 2,
    "query": {},
    "items": [
      {
        "id": "5ae087427d9cda0007f35520",
        "createdAt":"2018-04-25T13:48:50.327Z",
        "updatedAt":"2018-04-25T13:48:50.327Z",
        "myColumn": "value1"
      },
      {
        "id": "5ae0874821d0160005aa731c",
        "createdAt":"2018-04-25T13:48:50.327Z",
        "updatedAt":"2018-04-25T13:48:50.327Z",
        "myColumn": "value2"
      }
    ]
  }
  ...
}

Node Errors

Given a response path of rowsResult, a failed row query result might look like:

{
  ...
  "rowsResult": {
    "error": {
      "type": "NotFound",
      "message": "Data Table was not found"
    }
  },
  ...
}

There are two common types of errors that can occur with this node:

  • NotFound: This means that the data table you requested to query not found. It may have been deleted elsewhere, or you may be dynamically resolving to a data table ID that does not exist.
  • Validation: This means there is an issue with your query or query options. For example, you might be referencing a column that does not exist, or using an operator not valid for the type of column. In the case of a validation error, the message property will have more details on the particular source of the error.