Skip to main content

IntegrationCollections

Read integration collections and manage their rows.

More information about the module's user interface https://doc.oneentry.cloud/docs/category/integration-collections (opens in a new tab)


The IntegrationCollections module reads collections and manages their rows. A collection is a structured table of records used to integrate OneEntry with external services and systems. A form defines each collection's schema, and each record (row) holds the submitted formData.

Define a collection and its form in the admin panel, then fetch, create, update and delete its rows from your app. The SDK reads collections and manages their rows; it doesn't change the schema.

Quickstart​

Initialize the module from defineOneEntry:


const { } = defineOneEntry(
, {
}
);

Fetch all collections and read their fields:

// Returns an array of collections (langCode defaults to the configured language).
const collections = await IntegrationCollections.getICollections();
if ('statusCode' in collections) throw new Error(collections.message);

collections.forEach((collection) => {
console.log(collection.id, collection.identifier, collection.formId);
});

Collections and rows​

A collection (ICollectionEntity) is the table definition: its form schema and metadata. It references a form (formId) and an attribute set, and carries localized info.

A row (ICollectionRow) is a single record in a collection. It holds formData (an array of { marker, type, value }), timestamps and an optional linked entity (entityType / entityId).

Collection object​

{
id: 1,
identifier: 'collection1',
formId: 1234,
localizeInfos: { title: 'Admins text' },
attributeSetId: 1234,
selectedAttributeMarkers: 'collection_marker'
}

Row object​

{
id: 1,
createdDate: '2025-06-06T19:08:54.616Z',
updatedDate: '2025-06-06T19:08:54.616Z',
collectionId: 1,
formData: [
{ marker: 'name_1', type: 'string', value: 'Value' }
],
entityType: null,
entityId: null,
attributeSetIdentifier: null
}

Creating or updating rows​

Pass a form object (ICollectionFormObject) with the form identifier and the field values. Use the markers and types of the collection's form. The API does not check them and stores the values as sent:

const body = {
formIdentifier: 'collection-form',
formData: [
{ marker: 'collection_marker', type: 'string', value: 'Collection marker' }
]
};

await IntegrationCollections.createICollectionRow('collection1', body);

Things to know​

Collections and their forms are created and configured in the OneEntry admin panel.

deleteICollectionRowByMarkerAndId() requires the collections.row.delete right; without it, the deletion fails.

Use validateICollectionMarker() to check whether a marker is still free: valid: true means no collection uses it.


Methods​

MethodDescription
getICollections()Get collections (paginated).
getICollectionById()Get a single collection by ID.
getICollectionRowsById()Get rows of a collection by ID (paginated).
getICollectionRowsByMarker()Get the first 30 rows of a collection by marker.
getICollectionRowByMarkerAndId()Get a single row by collection marker and row ID.
validateICollectionMarker()Check whether a collection marker is free to use.
createICollectionRow()Create a row in a collection.
updateICollectionRow()Update a row in a collection.
deleteICollectionRowByMarkerAndId()Delete a collection row (requires the collections.row.delete right).