WorkflowsFunctionsCRUD Operations
Get Single Record
Find and retrieve one record from a table
Get Single Record
Search for and retrieve a single record from a table based on your search criteria. Use this when you need to find one specific record.
Technical Name: FetchMDataFunc
Properties
- Execution Mode: SYNC
- Type: NATIVE
- Category: CRUD Operations
- Function ID:
2f9a1ea8-5d9a-4f2b-a8f6-8f6b5d9a1ea1
Input Schema
Required Parameters
| Parameter | Type | Description |
|---|---|---|
queryMaster | object | Query configuration object for building the SQL query |
[Image placeholder: FetchMData function configuration]
Input Example
{
"queryMaster": {
"mobjectId": "3f9a1ea8-5d9a-4f2b-a8f6-8f6b5d9a1ea9",
"filters": [
{
"field": "email",
"operator": "equals",
"value": "john@example.com"
}
],
"fields": ["id", "name", "email", "status"]
}
}Query Master Configuration
The queryMaster object supports the following properties:
| Property | Type | Description |
|---|---|---|
mobjectId | string (uuid) | The Object to query |
filters | array | Array of filter conditions |
fields | array | Fields to return in the result |
orderBy | object | Sort configuration |
limit | integer | Maximum number of records (default: 1) |
Filter Operators
Supported operators in filter conditions:
equals- Exact matchnotEquals- Not equal tocontains- Contains substringstartsWith- Starts with valueendsWith- Ends with valuegreaterThan- Greater thanlessThan- Less thanin- Value in arrayisNull- Field is nullisNotNull- Field is not null
[Image placeholder: Query builder interface]
Output Schema
Returns a single MData record with all requested fields:
{
"id": "7f8a2ea8-6d9a-5f3b-b9f7-9f7b6d9a2eb1",
"name": "John Doe",
"email": "john@example.com",
"status": "Active",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}Use Cases
Fetch by ID
Retrieve a specific record by its ID:
{
"queryMaster": {
"mobjectId": "customer-mobject-id",
"filters": [
{
"field": "id",
"operator": "equals",
"value": "7f8a2ea8-6d9a-5f3b-b9f7-9f7b6d9a2eb1"
}
]
}
}Fetch by Email
Find a customer by email address:
{
"queryMaster": {
"mobjectId": "customer-mobject-id",
"filters": [
{
"field": "email",
"operator": "equals",
"value": "customer@example.com"
}
],
"fields": ["id", "name", "email", "phone", "address"]
}
}Workflow Example
Start → FetchMData → CheckIfExists → ProcessRecord → End[Image placeholder: FetchMData workflow example]
Error Handling
Record Not Found
When no record matches the query:
{
"error": "No record found matching the query criteria",
"timestamp": "2024-01-15T10:30:00Z"
}Best Practices
- Always specify required fields to minimize data transfer
- Use indexed fields in filters for better performance
- Handle null results gracefully in your workflow
- Cache frequently accessed data to reduce database load
Related Functions
- MultipleRecordFetchMData - Fetch multiple records
- InsertMData - Insert or update records
[Image placeholder: Dynamic query configuration]