Bulk Insert Records
Add multiple records to a table at once
Bulk Insert Records
Add multiple records to a table in a single operation. This is faster than adding records one by one and helps keep your data organized.
Technical Name: BulkInsertMDataFunc
Properties
- Execution Mode: SYNC
- Type: NATIVE
- Category: CRUD Operations
- Function ID:
8a1b2c3d-4e5f-6789-abcd-ef0123456789
Input Schema
Required Parameters
| Parameter | Type | Description |
|---|---|---|
mobjectId | string (uuid) | The UUID of the Object to insert data into |
dataArray | array | Array of data objects to insert |
Optional Parameters
| Parameter | Type | Description |
|---|---|---|
data | object | Constant data to be merged into each record in the array |
[Image placeholder: BulkInsertMData configuration panel]
Input Example
{
"mobjectId": "3f9a1ea8-5d9a-4f2b-a8f6-8f6b5d9a1ea9",
"dataArray": [
{
"name": "John Doe",
"email": "john@example.com",
"status": "Active"
},
{
"name": "Jane Smith",
"email": "jane@example.com",
"status": "Active"
}
],
"data": {
"source": "API Import",
"importedAt": "2024-01-15T10:30:00Z"
}
}Output Schema
| Field | Type | Description |
|---|---|---|
success | boolean | Whether the bulk operation was successful |
data | array | Array of created MData records |
totalProcessed | integer | Total number of records processed |
errors | array | Array of any errors that occurred during processing |
[Image placeholder: BulkInsertMData output visualization]
Performance Benefits
BulkInsertMData provides significant performance improvements:
- Single Database Transaction: All inserts in one transaction
- Reduced Network Overhead: One API call vs. many
- Optimized Validation: Batch validation of all records
- Faster Execution: Up to 100x faster than individual inserts
[Image placeholder: Performance comparison chart]
Best Practices
- Batch Size: Keep batches between 100-1000 records for optimal performance
- Validation: Pre-validate data before bulk insert to avoid partial failures
- Error Handling: Always check the errors array in the response
- Constant Data: Use the
dataparameter for fields common to all records
Related Functions
- InsertMData - Insert single records
- ForEach - Process arrays with custom logic