# Lead List Transformer: Map Columns, Merge and CRM Export (`opendatadesk/lead-list-transformer`) Actor

Rename and map columns, merge several lead lists, normalize country codes and URLs, and export a CRM-ready table for HubSpot, Pipedrive or Salesforce. Nothing is dropped.

- **URL**: https://apify.com/opendatadesk/lead-list-transformer.md
- **Developed by:** [Open Data Desk](https://apify.com/opendatadesk) (community)
- **Categories:** Lead generation, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.50 / 1,000 rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Lead List Transformer: Map Columns, Merge and CRM Export

Take one or more lead lists, map the columns, normalize country codes and websites, and export a table that is ready to import into HubSpot, Pipedrive or Salesforce. Nothing is dropped. No external look-ups and no scraping.

### What does Lead List Transformer do?

It only works on data you provide: a JSON list, a CSV, or several CSVs that you want to stack together.

Typical uses:

- Rename messy export columns from a Google Maps or LinkedIn extract into a single standard set.
- Merge two or three lists into one file, keeping every row.
- Turn country names such as "Denmark" or "United Kingdom" into DK and GB, and add https:// to websites that have no scheme.
- Split a full name into first and last name, but only when you ask for that.
- Export columns that match a common HubSpot, Pipedrive or Salesforce import template.

This Actor does not remove duplicates and does not check whether an email or website still works. Use it together with Lead List Cleaner if you need that.

### What data do you get?

The output columns depend on the CRM template you pick. In the standard layout you get `email`, `firstName`, `lastName`, `fullName`, `phone`, `company`, `website`, `jobTitle`, `city`, `state`, `country`, `postalCode` and `address`. Extra columns that were not mapped are kept in `extra`.

Every row also has:

| Field | What it is |
| --- | --- |
| `issues` | Notes such as `country_unrecognised` or `url_invalid`, never a reason to drop the row |
| `status` | `ok`, `ok_with_issues`, or `skipped_limit` |
| `sourceName`, `sourceIndex`, `rowNumber` | Which input list the row came from |

#### Example output

One mapped row from a test run on a small example list. Every input row is written back.

```json
{
    "email": "ada@example.com",
    "firstname": "Ada",
    "lastname": "Lovelace",
    "phone": null,
    "company": "Analytical Engines",
    "website": "https://example.com",
    "jobtitle": null,
    "city": null,
    "state": null,
    "country": "GB",
    "zip": null,
    "address": null,
    "issues": [],
    "status": "ok",
    "sourceName": "records",
    "sourceIndex": 0,
    "rowNumber": 1
}
```

### Nothing is silently dropped

Every input row is written back. Invalid websites or unknown country names stay in the file and are flagged. Several lists are stacked, not inner-joined, so a lead that appears in two files appears twice.

### How to use it

1. Open the Input tab.
2. Paste records as JSON, or a CSV with a header row, or both.
3. Optionally add more CSV lists to merge, a column map, a CRM template, and whether to split full names.
4. Click Start and download the result as CSV or Excel for your CRM.

### Input options

- **Records**: a JSON list of objects.
- **CSV** and **More CSV lists to merge**: each item is a full CSV with a header row.
- **Column map**: your column name to a standard field, if auto-detect gets it wrong.
- **Split full names**: off by default. When on, the last word becomes the last name.
- **CRM column template**: standard fields, HubSpot, Pipedrive or Salesforce.
- **Normalize country codes** and **Normalize website URLs**: on by default.

### How much does it cost?

You pay for each row that is written. The price per 1,000 rows is shown at the top of this page, and you can set a maximum cost per run.

### Data source and legal

There is no external data source. The Actor only transforms the lists you give it, and it does not store them after the run. You are responsible for having a lawful basis to process the personal data in those lists.

### Issues and requests

If a mapping looks wrong or you need another CRM template, please open an issue on the Issues tab with a sample header row (no personal data).

# Actor input Schema

## `records` (type: `array`):

A JSON list of lead objects. You can also paste CSV below, or both. Several sources are merged in order.

## `csvText` (type: `string`):

Paste a CSV with a header row. Combined with the records above if both are set.

## `additionalCsv` (type: `array`):

Each item is a full CSV with a header row. All lists are stacked, not deduplicated. Nothing is dropped.

## `columnMap` (type: `object`):

Optional map from your column names to standard fields: email, firstName, lastName, fullName, phone, company, website, jobTitle, city, state, country, postalCode, address.

## `splitFullName` (type: `boolean`):

Off by default. When on, a full name is split into first and last name (last word is the last name) if those fields are empty.

## `crmTemplate` (type: `string`):

Rename the output columns to match a common import template.

## `normalizeCountryCodes` (type: `boolean`):

Turn country names such as Denmark or United States into ISO 3166-1 alpha-2 codes (DK, US).

## `normalizeUrls` (type: `boolean`):

Add https:// when a website has no scheme, and keep only http or https URLs.

## `maxItems` (type: `integer`):

Stops writing after this many rows. Remaining input rows get status skipped_limit rather than being dropped.

## Actor input object example

```json
{
  "records": [
    {
      "Full Name": "Ada Lovelace",
      "Email": "ada@example.com",
      "Company": "Analytical Engines",
      "Country": "United Kingdom",
      "Website": "example.com"
    },
    {
      "Full Name": "Alan Turing",
      "Email": "alan@example.com",
      "Company": "Bletchley",
      "Country": "UK",
      "Website": "https://example.org"
    }
  ],
  "splitFullName": false,
  "crmTemplate": "none",
  "normalizeCountryCodes": true,
  "normalizeUrls": true,
  "maxItems": 10000
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset of mapped rows. Each input row is written back.

## `summary` (type: `string`):

A short JSON summary of the run, including counts.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "records": [
        {
            "Full Name": "Ada Lovelace",
            "Email": "ada@example.com",
            "Company": "Analytical Engines",
            "Country": "United Kingdom",
            "Website": "example.com"
        },
        {
            "Full Name": "Alan Turing",
            "Email": "alan@example.com",
            "Company": "Bletchley",
            "Country": "UK",
            "Website": "https://example.org"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("opendatadesk/lead-list-transformer").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "records": [
        {
            "Full Name": "Ada Lovelace",
            "Email": "ada@example.com",
            "Company": "Analytical Engines",
            "Country": "United Kingdom",
            "Website": "example.com",
        },
        {
            "Full Name": "Alan Turing",
            "Email": "alan@example.com",
            "Company": "Bletchley",
            "Country": "UK",
            "Website": "https://example.org",
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("opendatadesk/lead-list-transformer").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "records": [
    {
      "Full Name": "Ada Lovelace",
      "Email": "ada@example.com",
      "Company": "Analytical Engines",
      "Country": "United Kingdom",
      "Website": "example.com"
    },
    {
      "Full Name": "Alan Turing",
      "Email": "alan@example.com",
      "Company": "Bletchley",
      "Country": "UK",
      "Website": "https://example.org"
    }
  ]
}' |
apify call opendatadesk/lead-list-transformer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,opendatadesk/lead-list-transformer"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Q7PdXVTFxP8Er3YrX/builds/lIaIOcblguVlK8ZdY/openapi.json
