5 min readUpdated Mar 2, 2026

createRecord Documentation

Overview

The createRecord logic is designed to facilitate the creation of new records within the Vantage contacts application. This functionality allows users to either create a single record or multiple records simultaneously, utilizing both static field values and dynamic input data. The component is integral for applications that require seamless data entry and management within contact records.

Purpose

The primary purpose of the createRecord function is to create records in the contacts app by integrating with the application's data storage provider. It is particularly useful when bulk importing contact data or dynamically generating records based on user input or external data sources.

Settings

The createRecord function is configured through several critical settings, detailed as follows:

1. staticFields

2. appType

How It Works

The createRecord function begins by determining the context it operates in, including the clientId and userId.

  1. Error Handling: If the clientId is missing from the execution context, the function immediately returns an error response.

  2. Fetching Application Configuration: It retrieves the app's configuration based on the specified clientId and appType.

  3. Data Input Handling: It determines the input data, which can be provided directly or can default to the staticFields if no other input is available. If multiple records are to be created, it supports an array of data.

  4. Record Creation: The function iteratively creates new records by merging staticFields with each item from the input. Each created record is then collected in an array.

  5. Output: Upon successful record creation, the function returns the created records. If any error occurs during the process, it catches the error and formats it into a user-friendly message.

Data Expectations

The createRecord function expects the following data inputs:

Integration with AI

While the current version of createRecord does not explicitly integrate with AI functionalities, it is designed such that it could be enhanced for future versions. For instance, fields created could leverage AI algorithms for data validation, sorting, or enriching data with additional contextual information from other sources.

Billing Impact

The createRecord functionality operates within the existing bounds of Vantage’s operational framework. Billing implications arise mainly from the volume of records created and the frequency of calls made to the service, particularly if there are thresholds for record creation in the user’s plan. Users should monitor their usage as excessive record creation may lead to additional charges depending on their subscription model.

Use Cases & Examples

Use Cases

  1. Bulk Import of Contacts: A marketing team wants to upload a list of new leads to their contacts app for an upcoming campaign. They can provide an array of contact details and utilize the createRecord function to import all at once.

  2. Creating Default Contact Records: A user wants to establish default values for new contacts. The marketing tool can set up static fields such as source or campaignID, ensuring that every newly created record contains this vital information without needing to input it individually.

  3. Integration with Third-Party Applications: A CRM system needs to synchronize new leads from a web form. When users submit their contact information online, the system can invoke createRecord to instantly store these leads in the contacts application.

Detailed Example

Use Case: Bulk Import of Contacts

Configuration Example:

json
{
  "inputs": {
    "data": [
      { "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com" },
      { "firstName": "Jane", "lastName": "Smith", "email": "jane.smith@example.com" }
    ]
  },
  "config": {
    "staticFields": {
      "source": "Web Form"
    }
  },
  "context": {
    "clientId": "12345",
    "userId": "67890"
  }
}

Explanation: In this configuration, two new contact records for John Doe and Jane Smith are created. Each record will automatically include the static field source with the value Web Form. This ensures that whenever these records are viewed later, teams can see the origin of these contacts.

In conclusion, createRecord serves as a powerful tool for efficiently managing contact records in Vantage, with extensive options for customization and operational flexibility.