> For the complete documentation index, see [llms.txt](https://bitpicky.gitbook.io/sheetwork/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bitpicky.gitbook.io/sheetwork/master/usage/sheet-configuration/column-operations-and-advanced-controls.md).

# Column Operations & Advanced Controls

## Column Transformations

Sheetwork can perform a series of transformation on your columns. You'll set these up by creating a new `columns` block in your yml as you'll see below

### Data type casting

By default, everything that comes from a Google Sheet will be loaded as a **string**. But you might not want it to land in your database as a string. Here comes column-based casting! Building on the previous example here's what you could do:

```yaml
sheets:
  - sheet_name: test_sheet
    sheet_key: 10JJdwwd_lm4556uwedu4zu5u6r0h2VIDTjRXg
    target_schema: sandbox
    target_table: my_google_sheet
    # create a new columns block
    columns:
      - name: column_a # name of the column in your sheet
        datatype: int
```

#### Supported Data Types

Currently supported data types are:

```
int: integer
numeric: decimals and other kinds of non-whole number (precision 38,18)
varchar: for strings
date: for dates
boolean: for True False
timestamp: for a datetime object
```

### Column Renaming

This one is fun, it's not uncommon that your google sheet might contain a name that doesn't fit in your database or that is not up to your conventions. You can rename if easily as follows:

```yaml
sheets:
  - sheet_name: test_sheet
    sheet_key: 10JJdwwd_lm4556uwedu4zu5u6r0h2VIDTjRXg
    target_schema: sandbox
    target_table: my_google_sheet
    # create a new columns block
    columns:
      - name: column_a # name of the column in your sheet
        datatype: int
        identifier: "An AwkwardlyNamed Column Gosh that is ugly"
```

The `identifier:` field should be the exact copy of the Google Sheet column you want to rename. That is why we store it between `"` the `name:` field becomes the way you'll refer to the new column from now on. When no `identifier` is provided name will need to be the exact column in the google sheet.

## Column Exclusion

It's not uncommon for google sheets to contain a lot more columns than you'd want. That's where `exclude_colums:` comes in handy! You can list as a many columns as you want to exclude from the import by adding a list of columns as shown below.&#x20;

```yaml
sheets:
  - sheet_name: test_sheet
    sheet_key: 10JJdwwd_lm4556uwedu4zu5u6r0h2VIDTjRXg
    target_schema: sandbox
    target_table: my_google_sheet
    # create a new columns block
    columns:
      - name: column_a # name of the column in your sheet
        datatype: int
        identifier: "An AwkwardlyNamed Column Gosh that is ugly"
    excluded_columns: ['Bad COlumn', 'another bad one I do not want']
```

## Column Name Formatting

### Not a fan of CamelCase?

For whatever reason, you might want to convert those CamelCased columns into snake\_cased columns, `snake_case_camel` got your back!

{% hint style="info" %}
In fact Snowflake imposes an ALL\_CAPS convention on its column name. This means that ingesting the following column "CamelCasesCol" would end up in your database as this ugly, unreadable thing: **CAMELCASESCOL** 🤮
{% endhint %}

```yaml
sheets:
  - sheet_name: test_sheet
    sheet_key: 10JJdwwd_lm4556uwedu4zu5u6r0h2VIDTjRXg
    target_schema: sandbox
    target_table: my_google_sheet
    # create a new columns block
    columns:
      - name: column_a # name of the column in your sheet
        datatype: int
        identifier: "An AwkwardlyNamed Column Gosh that is ugly"
    excluded_columns: ['Bad COlumn', 'another bad one I do not want']
    snake_case_camel: True
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://bitpicky.gitbook.io/sheetwork/master/usage/sheet-configuration/column-operations-and-advanced-controls.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
