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

# MultiColumnRename

> Quickly standardize column names using a consistent naming pattern

export const gemName_0 = "MultiColumnRename"

export const execution_engine_0 = "the SQL warehouse"

<Info>This gem runs in {execution_engine_0}.</Info>

## Overview

Use the MultiColumnRename gem to efficiently rename several columns in your dataset at the same time. This gem allows you to apply a consistent naming pattern by adding a prefix or suffix to selected columns, or perform advanced renaming using custom SQL expressions.

<Tip>
  The {gemName_0} gem has a corresponding interactive gem example. See [Interactive gem
  examples](/data-analysis/gems/gems#interactive-gem-examples) to learn how to run sample pipelines
  for this and other gems.
</Tip>

## Prerequisites

* Add `prophecy_basics` package version 1.0.0 or higher to your project.

## Parameters

| Field                    | Description                                                                                                        |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------ |
| Select columns to rename | Set of columns that you will rename.                                                                               |
| Rename method            | How you will rename columns. <br />You can either add a prefix/suffix, or choose advanced rename (SQL expression). |

## Example

Assume you have the following table that includes the weather forecast for the next four days.

<div class="table-example">
  | DatePrediction | TemperatureCelsius | HumidityPercent | WindSpeed | Condition |
  | -------------- | ------------------ | --------------- | --------- | --------- |
  | 2025-03-01     | 15                 | 65              | 10        | Sunny     |
  | 2025-03-02     | 17                 | 70              | 12        | Cloudy    |
  | 2025-03-03     | 16                 | 68              | 11        | Rainy     |
  | 2025-03-04     | 14                 | 72              | 9         | Sunny     |
</div>

To standardize column names by converting them to lowercase, use the **Advanced rename** option in the MultiColumnRename gem with a custom SQL expression.

1. Create a **MultiColumnRename** gem.

2. Open the gem configuration and stay in the **Visual** view.

3. Under **Select columns to rename**, select all columns.

4. For the **Rename method**, choose **Advanced rename**.

5. Click **Select expression > Function**.

6. Search for and select the `lower` function.

7. Inside of the `lower` function, click **expr > Custom Code**.

8. Inside of the code box, write `column_name`. This applies the function to the column name.

9. Click **Done** on the code box, and then click **Save** on your gem.

### Result

After saving and running the gem, all selected columns will be renamed using the lower function. In this case, all column names will be lowercase in the output table.

<div class="table-example">
  | `dateprediction` | `temperaturecelsius` | `humiditypercent` | `windspeed` | `condition` |
  | ---------------- | -------------------- | ----------------- | ----------- | ----------- |
  | 2025-03-01       | 15                   | 65                | 10          | Sunny       |
  | 2025-03-02       | 17                   | 70                | 12          | Cloudy      |
  | 2025-03-03       | 16                   | 68                | 11          | Rainy       |
  | 2025-03-04       | 14                   | 72                | 9           | Sunny       |
</div>
