Data Collections

Data collections allow working with data in an external application using a consistent API. Read more on data collections here: Data Collections

The Data page of the connector builder shows an overview of the data collections and allows you to create new ones.
You can perform bulk operations on data collections by selecting a few of them and choosing an action in the column you want to change.

Fields Schema

This is a Data Schemas for the fields that can be read or written for records in the data collection.

It is recommended that all the fields that could participate in any operation of this collection be present in the fields schema. If some fields are only available in read or write operations, you can mark them as readOnly or writeOnly. Furthermore, you can configure which methods are available for which operations in the corresponding operation configuration.

Custom Fields

If a data collection supports custom fields that can be configured on a per-connection basis, you can implement a customFields function that returns the custom fields schema.
The custom fields schema will be merged with fieldsSchema when returning the collection's specification.

Operations

You can configure the following operations for the data collection:

OperationDescription
listRead all the records from the collection (with optional filters).
findByIdGet one record from the collection using its id.
matchFind a single matching record in a data collection using provided fields (e.g., by email).
searchFind a list of records using a string query. Supports type-ahead search whenever possible.
createCreate one record in a data collection.
updateUpdate a record in a data collection using its id.
deleteDelete a record with a given id.

Operation Parameters

Data collection operations can have an arbitrary set of parameters that can be used in the operation implementation.

Operation parameters are merged with data collection parameters into a single parameters argument passed to the operation.
If parameter names clash, data collection parameters take precedence.

Fields Transformation

When you want to transform fields that are coming from the API before returning them from the connector, or transform fields that come from the client before sending them to the API, you can use fieldsFromApi and fieldsToApi functions respectively.

These functions will be automatically applied to fields before calling operation implementations.

This could be useful if:

  • Fields in the API are inconsistent between endpoints.
  • Field structures in the API are too complex and you want to simplify them.

Dynamic Specification

If the data collection specification (name, fieldsSchema, operations, or events configuration) should be determined dynamically, you can use a dynamic specification.
It is a function that returns a specification object.

Mixins

When multiple data collections share the implementation of some of their functions, you can use mixins.
If a collection uses a mixin, all the functions from the mixin will be used as the collection's function unless overridden.

If a mixin collection has parameters, each collection that uses the mixin can provide different parameter values.