WorkflowsFunctionsSystem Functions
Load Data from Database
Execute SQL queries against database connections and optionally load results into Objects
Load Data from Database
Execute SQL SELECT queries against external database connections and optionally load the results into Objects. This function provides secure database connectivity with SQL injection protection and field mapping capabilities.
Technical Name: DbDataLoadFunc
Properties
- Execution Mode: SYNC
- Type: NATIVE
- Category: System Functions
- Function ID:
343e5e27-2e72-4156-8044-2460405a33fe
Input Schema
Required Parameters
| Parameter | Type | Description |
|---|---|---|
connectionId | string (uuid) | UUID of the database connection to use |
sqlQuery | string | SQL SELECT query to execute (SELECT statements only) |
Optional Parameters
| Parameter | Type | Description |
|---|---|---|
mobjectId | string (uuid) | UUID of the Object where results will be stored. Omit for query-only execution |
batchSize | integer | Batch size for processing large result sets when creating MData (default: 1000, max: 10000) |
fieldMappings | object | Field mappings to transform source data fields to target MData fields |
[Image placeholder: DbDataLoad function configuration panel]
Input Example
Query-Only Execution
Execute a query and return raw data without storing:
{
"connectionId": "database-connection-uuid",
"sqlQuery": "SELECT customer_id, customer_name, email FROM customers WHERE status = 'active'"
}Data Loading with Object
Execute a query and load results into an Object:
{
"connectionId": "database-connection-uuid",
"sqlQuery": "SELECT customer_id, customer_name, email FROM customers WHERE created_date >= '2024-01-01'",
"mobjectId": "customer-mobject-uuid",
"fieldMappings": {
"customer_id": "customerId",
"customer_name": "customerName"
},
"batchSize": 1000
}Output Schema
| Field | Type | Description |
|---|---|---|
success | boolean | Whether the operation completed successfully |
recordsProcessed | integer | Total number of records processed from the query result |
recordsCreated | integer | Number of records successfully created in the Object (equals recordsProcessed for query-only mode) |
recordsFailed | integer | Number of records that failed to be created (0 for query-only mode) |
executionTimeMs | integer | Total execution time in milliseconds |
errors | array (string) | List of error messages if any failures occurred |
Output Example
{
"success": true,
"recordsProcessed": 1000,
"recordsCreated": 995,
"recordsFailed": 5,
"executionTimeMs": 1234,
"errors": [
"Record 123: Validation failed - email format invalid"
]
}[Image placeholder: DbDataLoad output visualization]
Security Features
- SELECT-Only: Only SELECT statements are allowed
- Dangerous Keywords Blocked: Blocks DROP, DELETE, UPDATE, INSERT, ALTER, CREATE, TRUNCATE, EXEC, EXECUTE
- Prepared Statements: Uses parameterized queries internally
Use Cases
Data Migration
Migrate data from legacy systems:
Start → DbDataLoad(Extract) → TransformData → InsertMData → EndScheduled Synchronization
Sync data from external databases on a schedule:
{
"connectionId": "source-db-connection-uuid",
"sqlQuery": "SELECT * FROM external_customers WHERE updated_date >= '2024-01-01'",
"mobjectId": "customer-mobject-uuid",
"batchSize": 2000
}[Image placeholder: Database loading workflow examples]
Related Functions
- FetchMData - Retrieve data from Objects after loading
- InsertMData - Insert individual records
- BulkInsertMData - Bulk insert records