> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neuroncx.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Leads Import (Type 1)

> Bring in new leads from a Google Sheet — creating a user, transaction, and conversation for each row.

## Overview

Leads Import reads rows from a Google Sheet and creates a user record, a transaction, and a conversation for each one. It's the standard way to bulk-onboard leads into NeuronCx from an external source.

Attributes can be set in the same import — you don't need a separate step for them. Any column in your sheet whose header matches an existing `InstTrxMasterName` will be picked up automatically.

> [!NOTE]
>
> After the import runs, NeuronCx writes two values back into your sheet — `UserMasterId` and `TransactionMasterId` — so you have a record of exactly which NeuronCx records were created from each row.

***

## Prerequisites

* Your Google Sheet must be shared with edit access so NeuronCx can read from it and write IDs back to it.
* The sheet must contain all mandatory columns — see below. Column headers are case-sensitive and must match exactly.
* Any attribute columns you include must match an existing `InstTrxMasterName` for your institution. This import never creates new attribute definitions.

***

## Preparing Your Sheet

Your sheet must include the following columns. NeuronCx will read these to create each lead record.

![Sheet](https://mintcdn.com/neuroncx/YQLY19__ssBpkd6m/images/sheet.png?fit=max\&auto=format\&n=YQLY19__ssBpkd6m\&q=85\&s=e30b6c602ddfb9533c08db74731fb888)

| Column | Required | Notes |
| - | - | - |
| `UserName` | ✅ Yes | Display name for the new user |
| `UserMobile` | ✅ Yes | Used as the primary identifier |
| `UserEmail` | ✅ Yes | Email address for the new user |
| `ChannelId` | ✅ Yes | The channel the lead is assigned to |
| `TransactionType` | ✅ Yes | Type of transaction to create |
| `TransactionStageId` | ✅ Yes | Stage to assign the transaction |
| `SourceMasterId` | ✅ Yes | Lead source reference |
| `UserMasterId` | ✅ Yes — leave blank | Autofilled after import with the created user's ID |
| `TransactionMasterId` | ✅ Yes — leave blank | Autofilled after import with the created transaction's ID |
| Additional attribute columns | Optional | Header must exactly match the `InstTrxMasterName` |

> [!TIP]
>
> Leave `UserMasterId` and `TransactionMasterId` columns present but empty before running the import — NeuronCx will fill them in automatically once the records are created.

> [!TIP]
>
> To import attribute values alongside leads, add extra columns to your sheet with headers that exactly match your institution's `InstTrxMasterNames`. No extra setup needed.

***

## Running the Import

### Setting up a new import

**1. Open Imports**

Navigate to **Home > Ontology > Attributes > Import** and click **+ Import**.

![Import Button](https://mintcdn.com/neuroncx/YQLY19__ssBpkd6m/images/import_button.png?fit=max\&auto=format\&n=YQLY19__ssBpkd6m\&q=85\&s=fc3388fc3482680d5fb36ddb0023d5aa)

**2. Give it a label**

Enter a name that describes this import — for example, "June Leads Import."

![Label](https://mintcdn.com/neuroncx/YQLY19__ssBpkd6m/images/label.png?fit=max\&auto=format\&n=YQLY19__ssBpkd6m\&q=85\&s=efb90b8c22eb321cfac78d16bf44250b)

**3. Add the Google Sheet ID**

Paste the sheet ID, or paste the full Google Sheets URL — NeuronCx will extract the ID automatically.

![Sheet Id](https://mintcdn.com/neuroncx/YQLY19__ssBpkd6m/images/sheet_id.png?fit=max\&auto=format\&n=YQLY19__ssBpkd6m\&q=85\&s=36b25af54f0cd45a1a715666ba7fbf60)

**4. Verify**

Click **Verify**. NeuronCx confirms it can read the sheet and shows you the row and column count — use this to catch an empty or wrong sheet before continuing.

![Verify 1](https://mintcdn.com/neuroncx/YQLY19__ssBpkd6m/images/verify-1.png?fit=max\&auto=format\&n=YQLY19__ssBpkd6m\&q=85\&s=22a06e1a04a6b818f75cb07470a771ec)

**5. Select the import type**

Choose **Leads** from the import type list.

![Leads Import 1](https://mintcdn.com/neuroncx/YQLY19__ssBpkd6m/images/leads_import-1.png?fit=max\&auto=format\&n=YQLY19__ssBpkd6m\&q=85\&s=43fc91ef6667b5db5954ea2bae223f5d)

**6. Create the import**

Click **Create import**. The import now appears in your list, ready to run.

![Create Import](https://mintcdn.com/neuroncx/YQLY19__ssBpkd6m/images/create_import.png?fit=max\&auto=format\&n=YQLY19__ssBpkd6m\&q=85\&s=f5a9d2f5da777bc536a3cabeaf6e6bc5)

### Running an import on an existing sheet

**1. Find the import**

From the Data Import list, locate the import linked to your sheet.

![Selecting Sheet From Import List](https://mintcdn.com/neuroncx/YQLY19__ssBpkd6m/images/selecting_sheet_from_import_list.png?fit=max\&auto=format\&n=YQLY19__ssBpkd6m\&q=85\&s=d7faf13710a1749103baa57a82ceee8d)

**2. Click Import**

Click the **Import** button on that row to run it.

![Import Button On Existing Sheet](https://mintcdn.com/neuroncx/YQLY19__ssBpkd6m/images/import_button_on_existing_sheet.png?fit=max\&auto=format\&n=YQLY19__ssBpkd6m\&q=85\&s=e08070d3e30fbe3859c8028357340f82)

***

## What Happens After the Import Runs

Once each row is processed, NeuronCx schedules a background job to write the generated IDs back into your sheet.

* **`UserMasterId`** and **`TransactionMasterId`** are written back to each row, matched by `UserMobile`.
* The write-back runs approximately 2 minutes after the import, to allow record creation to complete.
* If the IDs aren't available yet on the first attempt, the job retries once per minute for up to 3 attempts total.

> [!NOTE]
>
> The write-back matches rows by `UserMobile`. Make sure there are no duplicate mobile numbers in your sheet — if a number appears more than once, only one row will be updated reliably.

***

## Checking the Result

Once the import completes, the run history table shows how many rows were read and how many records were created. Click a run's **Status** to open a detailed breakdown showing which rows succeeded, failed, or were skipped.

After the write-back runs, open your sheet and confirm that `UserMasterId` and `TransactionMasterId` are filled in for each row.

> [!TIP]
>
> If the ID columns are still empty a few minutes after the import, check the run detail for errors — the write-back may have retried and failed if the mobile number format in the sheet didn't match what NeuronCx stored.

***

## Limits to Keep in Mind

* Column headers are case-sensitive. `UserMobile` and `usermobile` are treated as different columns.
* Attribute columns must match an existing `InstTrxMasterName` exactly — unrecognised column headers are silently ignored.
* This import creates new records only. To update an existing lead's attributes after the fact, use a different import type.
* Only one import runs at a time. If another import is already running, this one will queue and wait its turn.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.