Monetize360

Get Multiple Records

Execute a query and retrieve multiple records from a table

Get Multiple Records

Execute a query and retrieve multiple records from a table based on your search criteria. Use this when you need to find and process multiple records at once.

Technical Name: MultipleRecordFetchMDataFunc

Properties

  • Execution Mode: SYNC
  • Type: NATIVE
  • Category: CRUD Operations
  • Function ID: 9e8cea51-9784-4df7-a100-db395bd84916

Input Schema

Required Parameters

ParameterTypeDescription
queryMasterobjectQuery configuration object for building the SQL query

[Image placeholder: MultipleRecordFetchMData function configuration]

Input Example

{
  "queryMaster": {
    "mobjectId": "3f9a1ea8-5d9a-4f2b-a8f6-8f6b5d9a1ea9",
    "filters": [
      {
        "field": "status",
        "operator": "equals",
        "value": "Active"
      }
    ],
    "fields": ["id", "name", "email", "status"],
    "orderBy": {
      "field": "createdAt",
      "direction": "desc"
    },
    "limit": 100
  }
}

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 to return

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

FieldTypeDescription
dataListarrayList of query result records
sqlstringThe SQL query that was executed

Each object in the dataList array contains the requested fields from the query.

Output Example

{
  "dataList": [
    {
      "id": "7f8a2ea8-6d9a-5f3b-b9f7-9f7b6d9a2eb1",
      "name": "John Doe",
      "email": "john@example.com",
      "status": "Active"
    },
    {
      "id": "8g9b3fb9-7e0b-6g4c-c0g8-0g8c7e0b3fc2",
      "name": "Jane Smith",
      "email": "jane@example.com",
      "status": "Active"
    }
  ],
  "sql": "SELECT id, name, email, status FROM customer WHERE status = 'Active' ORDER BY createdAt DESC LIMIT 100"
}

[Image placeholder: Multiple records output visualization]

Use Cases

Fetch All Active Records

Retrieve all active records from a table:

{
  "queryMaster": {
    "mobjectId": "customer-mobject-id",
    "filters": [
      {
        "field": "status",
        "operator": "equals",
        "value": "Active"
      }
    ],
    "orderBy": {
      "field": "name",
      "direction": "asc"
    },
    "limit": 1000
  }
}

Fetch Records by Date Range

Find records within a date range:

{
  "queryMaster": {
    "mobjectId": "order-mobject-id",
    "filters": [
      {
        "field": "createdAt",
        "operator": "greaterThanOrEquals",
        "value": "2024-01-01"
      },
      {
        "field": "createdAt",
        "operator": "lessThanOrEquals",
        "value": "2024-01-31"
      }
    ],
    "fields": ["id", "orderNumber", "totalAmount", "status"],
    "orderBy": {
      "field": "createdAt",
      "direction": "desc"
    }
  }
}

Process Records in Loop

Fetch multiple records and process them:

Start → MultipleRecordFetchMData → ForEach(ProcessRecord) → End

[Image placeholder: Workflow example]

Field Resolution

The function automatically resolves:

  • Picklist values - Converts picklist IDs to display names
  • External data sources - Resolves references to related records

Error Handling

No Records Found

When no records match the query:

{
  "dataList": [],
  "sql": "SELECT id, name FROM customer WHERE status = 'Inactive'"
}

Query Error

When the query fails:

{
  "error": "Error executing MultipleRecordFetchMDataFunc: Invalid field name"
}

Best Practices

  1. Use limit to control the number of records returned
  2. Specify required fields to minimize data transfer
  3. Use indexed fields in filters for better performance
  4. Order results for consistent processing
  5. Handle empty results gracefully in your workflow