Actions4
Create
AI-generatedOverview
This node interacts with the Pocketbase HTTP API to create a new element (record) in a specified Pocketbase collection. It is useful for automating data entry or integration workflows where new records need to be added to a Pocketbase database. For example, it can be used to add new user data, product entries, or any other collection data programmatically.
Use Case Examples
- Creating a new user record in a Pocketbase collection by specifying field values.
- Uploading binary data as part of a new record creation, such as an image or document.
- Sending a JSON body to create a record with complex nested data structures.
Properties
| Name | Meaning |
|---|---|
| Parameters | Various query parameters to control the creation request, such as pagination, filtering, sorting, and relation expansion. |
| Body Type | Defines the format of the data sent in the request body when creating or updating a record. Options include 'fields' (individual fields), 'bodyJson' (raw JSON), and 'binaryData' (binary file data). |
| Fields | Collection of fields and their values to be sent when 'Body Type' is set to 'fields'. Used to specify individual field data for the new record. |
| JSON Body | Raw JSON object to be sent as the request body when 'Body Type' is set to 'bodyJson'. Allows sending complex or nested data structures. |
| Binary Property Name | Name of the binary property containing the data to be sent when 'Body Type' is 'binaryData'. |
| Binary Field Name | Name of the binary field according to the collection's schema. If empty, binary data is sent as a file attachment. |
Output
JSON
id- Unique identifier of the created record.created- Timestamp when the record was created.updated- Timestamp when the record was last updated.collectionId- ID of the collection where the record was created.collectionName- Name of the collection where the record was created.expand- Expanded related fields if requested.
Dependencies
- Requires Pocketbase HTTP API credentials including the base URL and authentication token.
Troubleshooting
- Ensure the Pocketbase API credentials are correctly configured and have the necessary permissions to create records.
- Verify that the collection name or ID specified exists and is accessible.
- When using binary data, ensure the binary property name and field name match the collection schema.
- Check that the JSON body is correctly formatted and matches the collection schema to avoid validation errors.
- Common error messages include authentication failures, invalid collection or field names, and schema validation errors. Resolving these typically involves correcting credentials, verifying collection and field names, and ensuring data format compliance.
Links
- Pocketbase Records API Documentation - Official documentation for Pocketbase API endpoints related to record creation and management.