> ## 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.

# Lead Import With Attributes (Type 23)

> Bulk-import treatment-specific attribute data onto an existing transaction, such as an OBG visit history.

## Overview

Lead Import With Attributes brings in patient or lead attribute data tied to a specific, already-existing transaction — for example, importing an OBG (obstetrics) visit history datasheet so a patient's ongoing treatment details are tracked in NeuronCx.

> [!NOTE]
>
> This import doesn't create a new lead from scratch. It's for attaching or updating attribute data on a transaction that should already exist. If the lead doesn't exist yet, import it first using **Leads (Type 1)**, then run this import afterward.

***

## Prerequisites

* The transaction referenced in your sheet must already exist in NeuronCx, or be created first via a Leads (Type 1) import.
* Every row must include both `TransactionId` and `UserMasterId` — rows missing either of these are required fields.
* The attributes you're bringing in (for example, `OBG_ANCSession_1` or `OBG_Delivery_Status`) must already exist as attributes in NeuronCx. This import writes values against existing attributes — it doesn't create new ones.

***

## Preparing Your Sheet

Unlike External Identity or External Values imports, this sheet doesn't go through a separate mapping step — columns are matched directly by name. Your sheet's column headers should match the attribute names already set up in NeuronCx.

| Column | Required | Notes |
| - | - | - |
| `TransactionId` | ✅ Yes | The transaction this data belongs to. Must already exist |
| `UserMasterId` | ✅ Yes | The NeuronCx user this transaction belongs to |
| `UserName` | Optional | |
| `Doctor` | Optional | |
| `OBG_Last_Visted_Month` | Optional | |
| `OBG_MRI` | Optional | The patient's medical record identifier |
| `OBG_Last_Visted_Date` | Optional | |
| `OBG_Remarks` | Optional | |
| `OBG_Only_Doctor_Consultation` | Optional | |
| `OBG_ANCSession_1`, `OBG_ANCSession_2` | Optional | |
| `OBG_Delivery_Status` | Optional | |
| Visit-stage columns (e.g. `OBG_22_24_Weeks`, `OBG_30th_32nd_weeks_GROWTH_0/1`) | Optional | Any additional treatment-stage attributes you're tracking |

![Lead Import With Attributes sheet format](https://mintlify.s3.us-west-1.amazonaws.com/neuroncx/images/PLACEHOLDER.png)

> [!TIP]
>
> You don't need every column in this table — only include the attributes you actually want to import for this treatment. Any column NeuronCx doesn't recognize as an existing attribute is ignored.

***

## What Happens During the Import

For each row, NeuronCx checks the given `TransactionId` against the patient's existing transactions — both active and archived transactions are checked.

* If an **active transaction already exists**, the imported data is **appended** to that transaction.
* If **no active transaction exists**, a **new transaction is created** for that patient.

> [!WARNING]
>
> If the TransactionId in your sheet doesn't correspond to an existing lead at all, the row will fail. Make sure the lead has already been created — through a Leads (Type 1) import if necessary — before running this import.

***

## Running the Import

### Setting up a new import

**1. Open Imports**

Navigate to **Home > Ontology > Attribute Settings & Bulk Edit**, then click the **Imports** tab.

**2. Click + Import**

Click the **+ Import** button in the top right to open the New Import modal.

**3. Give it a label**

Enter a name that describes this import — for example, "OBG Visit History Import."

![Label 13](https://mintcdn.com/neuroncx/0GtZRq5g3Hj5jlVU/images/label-13.png?fit=max\&auto=format\&n=0GtZRq5g3Hj5jlVU\&q=85\&s=2edd02319ef17ae21339ff0eee744544)

**4. Add the Google Sheet ID**

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

![Sheet Id 7](https://mintcdn.com/neuroncx/0GtZRq5g3Hj5jlVU/images/sheet_id-7.png?fit=max\&auto=format\&n=0GtZRq5g3Hj5jlVU\&q=85\&s=0892ba87f4c3ae9e91bfe3cb6a2eeb56)

**5. Verify**

Click **Verify**. NeuronCx confirms it can read the sheet and shows you the row and column count.

![Verify 14](https://mintcdn.com/neuroncx/0GtZRq5g3Hj5jlVU/images/verify-15.png?fit=max\&auto=format\&n=0GtZRq5g3Hj5jlVU\&q=85\&s=728a4b57614f0962668295511e4dacdc)

**6. Select the import type**

In the Import type panel on the left, select **Leads & Contacts**. Then choose **Lead Import With Attributes** (`#23`) from the list on the right.

![Import Type Select 1](https://mintcdn.com/neuroncx/0GtZRq5g3Hj5jlVU/images/import-type-select-1.png?fit=max\&auto=format\&n=0GtZRq5g3Hj5jlVU\&q=85\&s=c87400ba5eb43eb3e93fb523d5069c9e)

**7. Create the import**

Click **Create import**. The import now appears in your list under Leads & Contacts, ready to run.

![Create Import 5](https://mintcdn.com/neuroncx/0GtZRq5g3Hj5jlVU/images/create-import-5.png?fit=max\&auto=format\&n=0GtZRq5g3Hj5jlVU\&q=85\&s=0ffc5286c63c144cb4a7c8d9f3ddec71)

### Running the import

**1. Find the import**

From the Data Import list, locate the import you just created. You can filter by **Leads & Contacts** to narrow the list.

**2. Open the import**

Click the arrow icon on the import row to open it.

**3. Click Import**

Click **Import** to run it. NeuronCx reads each row, matches it to the given transaction, and writes the attribute values.

![Import Button](https://mintcdn.com/neuroncx/0GtZRq5g3Hj5jlVU/images/import-button.png?fit=max\&auto=format\&n=0GtZRq5g3Hj5jlVU\&q=85\&s=ccb9e042a7a6f7cd74cf308e5c0019a2)

***

## Checking the Result

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

![Log 1](https://mintcdn.com/neuroncx/0GtZRq5g3Hj5jlVU/images/log-1.png?fit=max\&auto=format\&n=0GtZRq5g3Hj5jlVU\&q=85\&s=06599a2218a43f54d4118cb8093d9ca7)

***

## Limits to Keep in Mind

* `TransactionId` and `UserMasterId` are both required on every row. Rows missing either will fail.
* If the transaction doesn't exist yet for a given lead, run a Leads (Type 1) import first.
* 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.