---
title: "Find Replace Column"
method: POST
path: "/api/new_mdm/find_replace_column"
tags: ["MDM NEW"]
---

# Find Replace Column

`POST /api/new_mdm/find_replace_column`

**Function**: `find_replace_column`
**Type**: API Endpoint (POST)

**Purpose**:  
This endpoint facilitates finding and replacing column values in a specified table in the customer database.

**URL**:  
`POST /api/new_mdm/find_replace_column`

**Request Parameters**:
- `Customer_Key` (Header, required): An encoded string containing `lscode` and `firmcode` for the customer.
- `Table_Name` (Header, required): The name of the table to update.
- `input_data` (JSON Body, required): An object containing a list of column updates, each with `column_name`, `old_value`, and `new_value` properties.

**Notes**:  
- If `flag` is set to '1', the endpoint will return the distinct values of the column as specified in `input_data.updates[0].column_name`.
- If `flag` is not set to '1', the endpoint will replace the values in the column as specified in `input_data.updates`.

**Response**:  
The API returns a JSON object with the status of the operation.

## Headers

- `flag` string, required
- `Customer-Key` string, required
- `User-Code` string, required
- `Table-Name` string, required

## Request body

- FindAndReplace
  - `updates` ColumnUpdate[], required
    - `column_name` string, required
    - `values` object, nullable
    - `replace_all` union
      - integer
      - string

## Response `200`

Successful Response

- object

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/leapsurgebi/apis/leapsurgeapi.md) · [All operations](https://skmtc.dev/leapsurgebi/apis/leapsurgeapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/leapsurgebi/leapsurgeapi/revisions/5a6b1464bfeb/schema)
