4 min readUpdated Mar 2, 2026

Vantage Documentation: searchRecords

Purpose

The searchRecords logic in Vantage is designed to facilitate the retrieval of records from the designated application, specifically in the contacts app. It allows users to search for specific records using a query string and can return a limited number of results based on predefined criteria. The functionality is essential for businesses or applications needing quick access to contact data filtered by user-defined searches.

Settings

The searchRecords logic has two primary settings that dictate its operation. Below is an in-depth description of each setting:

1. Query

2. Limit

How It Works

The searchRecords function operates through the following sequence of steps:

  1. Context Handling: It retrieves the app type and user context (like clientId and userId).
  2. Input and Configuration Resolution: It checks for query input—if not provided, it falls back on the configured value. It also determines the limit, defaulting to 100 if not specified.
  3. Error Handling: If clientId is not available in the context, it returns an error indicating the missing clientId.
  4. Schema Retrieval: It retrieves the schema of the identified app type and determines which fields are searchable.
  5. Data Adapter Creation: The function creates a data adapter based on the storage provider specified in the application configuration.
  6. Record Searching: It invokes the searchRecords method of the adapter, passing the query and constraints defined by the schema.
  7. Output Formatting: Finally, it returns the matched records, sliced according to the limit. If any errors arise during execution, they are captured and returned.

Input Expectations

To function correctly, searchRecords expects the following input:

Use Cases & Examples

Use Cases

  1. Customer Support: A support team can quickly search through customer contact records based on queries related to customer names or issues, improving response time and service efficiency.

  2. Marketing Campaigns: Marketing teams can search for specific audience segments by querying contact records based on interests or demographics, allowing targeted outreach.

  3. Data Cleansing: Data analysts can search for specific records that might require verification or updates, optimizing the quality of contact data stored within the system.

Example Configuration

Use Case: A customer service representative needs to find all contacts related to a specific issue for follow-up.

Configuration:

json
{
  "inputs": {
    "query": "order issue"
  },
  "config": {
    "limit": 50
  },
  "context": {
    "nodeType": "contacts/searchRecords",
    "clientId": "12345",
    "userId": "67890"
  }
}

Expected Behavior: This configuration sets the query for searching records to "order issue" and limits the results to a maximum of 50 records. The representative will efficiently retrieve relevant contacts to address the issue, ensuring a prompt service response.

Billing Impact

While the implementation of the searchRecords logic itself does not directly contribute to billing, the results returned and the query processing capabilities may impact overall usage metrics, which can be part of the billing model. High-frequency use of this logic in a large dataset scenario may lead to increased processing costs, particularly if many requests are made in a short time. Monitoring the frequency of such queries is advisable for efficient cost management.