Monetize360

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

ParameterTypeDescription
queryMasterobjectQuery 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:

PropertyTypeDescription
mobjectIdstring (uuid)The Object to query
filtersarrayArray of filter conditions
fieldsarrayFields to return in the result
orderByobjectSort configuration
limitintegerMaximum number of records (default: 1)

Filter Operators

Supported operators in filter conditions:

  • equals - Exact match
  • notEquals - Not equal to
  • contains - Contains substring
  • startsWith - Starts with value
  • endsWith - Ends with value
  • greaterThan - Greater than
  • lessThan - Less than
  • in - Value in array
  • isNull - Field is null
  • isNotNull - 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

  1. Always specify required fields to minimize data transfer
  2. Use indexed fields in filters for better performance
  3. Handle null results gracefully in your workflow
  4. Cache frequently accessed data to reduce database load

[Image placeholder: Dynamic query configuration]