Collections
You can access, update, create and delete App Collection records from within your Functions.
Create Collection Record
If you want to create a new collection record, you can use the following code:
return await SUPERFLOW.app.collections.records.create({
"collection_id": "e8f6324f-1c65-4279-9c69-0c40419867c9",
"first name": "Alex",
"last name": "miller",
"email": "[email protected]",
"phone": "762727727222"
})
Example output:
{
"__sf_id": 1,
"__sf_created_at": "2025-09-04T11:14:56.419Z",
"__sf_updated_at": "2025-09-04T11:14:56.419Z",
"448b0e29-d9c3-4424-bcc1-426e782f182f": "alex",
"b625fe92-d9c4-4f24-81c5-0fbce1919b74": "miller",
"29c013ef-d829-41f7-9996-f3ca003db3bc": "[email protected]",
"bae1ce86-88a0-4d0d-88ba-dbb3f8398ab0": "762727727222"
}
In this example, a new collection record is created. The collection is returned a response that contains id, created_at, updated_at, and the properties of the collection.
Update Record by ID
You can update a Record by ID with the following code:
return await SUPERFLOW.app.collections.records.update({
"collection_id": "e8f6324f-1c65-4279-9c69-0c40419867c9",
"record_id": 3,
"email": "[email protected]"
})
Example output:
{
"__sf_id": 3,
"__sf_created_at": "2025-09-04T11:14:56.419Z",
"__sf_updated_at": "2025-09-04T11:20:49.627Z",
"448b0e29-d9c3-4424-bcc1-426e782f182f": "alex",
"b625fe92-d9c4-4f24-81c5-0fbce1919b74": "miller",
"29c013ef-d829-41f7-9996-f3ca003db3bc": "[email protected]",
"bae1ce86-88a0-4d0d-88ba-dbb3f8398ab0": "762727727222"
}
In this example we updated the record with the ID 3
and updated multiple fields including first name, last name, and email.
Update Record by Condition
You can update a Record by condition using the updateByName
method with the following code:
return await SUPERFLOW.app.collections.records.updateByName({
"collection_id": "e8f6324f-1c65-4279-9c69-0c40419867c9",
"condition": {
"column": "first name",
"condition": "eq",
"value": "First"
},
"first name": "alex"
})
This method allows you to update records based on a specific condition rather than by ID. In this example, we're updating the "first name" field to "Zia" for all records where the "first name" column equals "First".
Delete Record by ID
You can delete a Record by ID with the following code:
return await SUPERFLOW.app.collections.records.delete({
"collection_id": "e8f6324f-1c65-4279-9c69-0c40419867c9",
"record_id": 4
})
This will delete the record with ID 4
from the specified collection.
Delete Record by Condition
You can delete records by condition using the deleteByName
method with the following code:
return await SUPERFLOW.app.collections.records.deleteByName({
"collection_id": "e8f6324f-1c65-4279-9c69-0c40419867c9",
"condition": {
"column": "first name",
"condition": "eq",
"value": "alex"
}
})
This method allows you to delete records based on a specific condition. In this example, all records where the "first name" column equals "First" will be deleted.
List Collection Records
You can list collection records with advanced filtering, pagination, and sorting options:
return await SUPERFLOW.app.collections.records.list({
"collection_id": "e8f6324f-1c65-4279-9c69-0c40419867c9",
"limit": 10,
"page": 1,
"columns": ["first name", "last name"],
"order_by": "first name", // column name
"order": "DESC", // ASC or DESC
"filters": [
{
"column": "first name",
"condition": "eq",
"value": "adnan",
"connector": "" // and, or
},
{
"column": "first name",
"condition": "eq",
"value": "Moritz",
"connector": "or" // and, or
}
]
})
Parameters:
- collection_id: The ID of the collection to query
- limit: Number of records to return per page
- page: Page number for pagination
- columns: Array of column names to return (optional)
- order_by: Column name to sort by
- order: Sort direction ("ASC" or "DESC")
- filters: Array of filter conditions
- column: Column name to filter
- condition: Filter condition ("eq", "ne", "gt", "lt", "gte", "lte", "like", etc.)
- value: Value to filter by
- connector: Logical connector ("and", "or") - leave empty for the first filter
This method provides powerful querying capabilities for your collection data with support for complex filtering, sorting, and pagination.