Mapping

What is Mapping?

Mapping provides a simple way to connect your application to multiple systems with different APIs. Instead of building separate connections for each system, you work with one common API, and we handle the rest.

How Does Mapping Work?


Single API: You interact with a single API (e.g., /Contacts), and we take care of connecting to multiple different CRM types behind the scenes.

Centralized Data: Mappings let you organize your data in one consistent structure that fits your application's needs, even if the systems you connect to have different formats.

Automatic Translations: If different systems use different formats or values (e.g., one uses "High" for priority and another uses "1"), we translate them automatically to match your setup.


Why Use Mapping?


Saves Time: No need to create separate connections for each new system. Set up once, and you're ready to go.

Keeps Data Consistent: Mappings make sure data looks the same across all your systems.

Easy to Use: Focus on building your app, and let us handle the complicated connections.

Scales Easily: Adding new systems or making changes is simple—no need to redo everything.

Example


If you have a /myCompany endpoint for customer information, you can map it to multiple systems like Salesforce or HubSpot. When you send or receive data, Mappings automatically adjust the information to fit each system and keep everything consistent in your app. With Mappings, managing data across different systems is easier, faster, and more reliable!

Custom JavaScript (Custom JS)

Custom JavaScript gives you the flexibility to modify data fields during transformations, allowing you to format or structure data in ways that standard mappings cannot handle.

For example, if your transformation's contact object has separate fields for FirstName and LastName but your Mapping requires a single FullName field then you can use Custom JavaScript to combine FirstName and LastName into a single value for FullName

How Custom JS Works

Custom JavaScript is executed during the transformation process. You can read and modify specific data fields based on your requirements before the data is sent or received. The function includes several input parameters that help you work with data effectively.

Input Parameters

Common JavaScript Transformations and Examples

Here are some examples of how you can use JavaScript to transform data during a mapping process. These transformations rely on modifying data from the originalObject to create or update fields in the transormedObject At the end of the transformation, you must call done(transormedObject); to finalize the changes.

Testing Your JavaScript

- Use the Try Out feature to preview how your transformation modifies the data.

- Test with specific objects by providing their ID and rerunning the transformation.

- The tool will display the originalObject, transormedObject and the final request for validation.

Examples shown below should help you create efficient, tailored transformations for your mappings.

Combining Fields

transformedObject.fullName = `${originalObject.firstName} ${originalObject.lastName}`;

Dividing Fields

let splitName = originalObject.fullName.split(' ');
	transformedObject.firstName = splitName[0];
	transformedObject.lastName = splitName[1];

Replacing Unwanted Characters in Fields

transformedObject.fieldWithoutNewLines = originalObject.field.replace(/\r?\n|\r/g, "");

Two endpoints identify priority differently: one uses numbers (1 or 2) and the other descriptions (low or high).

// we prefer our priority to be the string representation, so we convert the endpoints "priorityNumber" field to the appropriate string representation here.

transformedObject.priority = transformedObject.priorityNumber === 1 ? 'low' : 'high';

Selecting only 1st phon number from the list of numbers as Contact

if (!fromVendor) { // Bridge to CRM
  if (originalObject.phone.length > 0) {
    transformedObject.Phone = originalObject.phone[0].number
  }
}
done(transformedObject);

RAW vs TRANSFORMED Records

RAW Records

These are unprocessed, original data entries exactly as they exist in the CRM system. RAW Records maintain the CRM's native field structure, naming conventions, and formatting.

They are ideal for scenarios where you need full access to the original data for custom processing, troubleshooting, or detailed analysis.

TRANSFORMED Records

These are processed data entries that have been formatted and standardized according to the Mapping rules configured within Grid Squid. Mapping defines how fields from the CRM are translated into a standardized format, ensuring uniformity across data from different CRMs. For example, if one CRM uses first_name and another uses FirstName the TRANSFORMED Record can consolidate this into a consistent field like first_name based on the Mapping.

TRANSFORMED Records are particularly useful when integrating with multiple CRMs, as they provide a unified structure that simplifies downstream processing and analysis.

By providing the flexibility to work with either RAW or TRANSFORMED Records, Grid Squid ensures that users can access CRM data in the format that best suits their needs, enabling seamless integration and streamlined workflows.