Tutorials12 min read

Tutorial: Setting Up Data Transformation Rules

Learn how to create rules that automatically transform your inventory data — pricing adjustments, field corrections, and conditional logic.

tutorialrulestransformationautomationdata processing

Tutorial: Setting Up Data Transformation Rules

Rules let you automatically transform inventory data as it flows through Carfluence. This tutorial covers creating rules for common scenarios.

What Are Rules?

Rules are condition-action pairs. When a vehicle matches the conditions, the actions are applied. Rules run automatically during every sync.

Example 1: Price Floor for Used Vehicles

Ensure no used vehicle is listed below $5,000:

bash
POST /api/v1/rules
{
  "name": "Used Vehicle Price Floor",
  "conditions": [
    {"field": "condition", "operator": "equals", "value": "used"},
    {"field": "price", "operator": "less_than", "value": "5000"}
  ],
  "actions": [
    {"type": "set_field", "field": "price", "value": "5000"}
  ]
}

Example 2: Auto-Tag Luxury Vehicles

Tag vehicles from luxury brands:

bash
POST /api/v1/rules
{
  "name": "Tag Luxury Brands",
  "conditions": [
    {"field": "make", "operator": "in", "value": "BMW,Mercedes-Benz,Audi,Lexus,Porsche"}
  ],
  "actions": [
    {"type": "set_field", "field": "tags", "value": "luxury"}
  ]
}

Example 3: Standardize Color Names

Normalize color variations:

bash
POST /api/v1/rules
{
  "name": "Normalize Black Colors",
  "conditions": [
    {"field": "exterior_color", "operator": "in", "value": "Blk,BLK,Ebony,Jet Black,Crystal Black Pearl"}
  ],
  "actions": [
    {"type": "set_field", "field": "exterior_color", "value": "Black"}
  ]
}

Testing Rules

Before activating a rule, test it against sample data:

bash
POST /api/v1/rules/:id/test
{
  "vehicle": {
    "vin": "1HGCM82633A004352",
    "make": "BMW",
    "model": "X5",
    "price": "3500",
    "condition": "used",
    "exterior_color": "Jet Black"
  }
}

The response shows what the vehicle would look like after the rule is applied, without actually modifying any data.

Rule Ordering

Rules execute in creation order. Keep this in mind when rules might conflict — the last rule to modify a field wins.

Operators Reference

OperatorDescription
equalsExact match
not_equalsDoes not match
containsString contains
inValue in comma-separated list
less_thanNumeric less than
greater_thanNumeric greater than
is_emptyField is null or empty
is_not_emptyField has a value
Last updated: December 14, 2025