# Insert Column

This activity inserts a new column to the user-specified table in the given workbook using the Microsoft Graph [Create Column](https://docs.microsoft.com/en-us/graph/api/table-post-columns?view=graph-rest-1.0\&tabs=http) API.

### Input

* **Connection Id:** [`GraphServiceClient Variable`](https://docs.visualyze.ai/getting-started/rpa-studio/variables#graphserviceclient) <mark style="color:red;">`Required`</mark>\
  Specifies the office 365 connection id.
* **Table Name:** [`String Argument`](https://docs.visualyze.ai/getting-started/rpa-studio/arguments#string)  <mark style="color:red;">`Required`</mark>\
  Specifies the name of the table in which the column is to be inserted.
* **Column Name:** [`String Argument`](https://docs.visualyze.ai/getting-started/rpa-studio/arguments#string)  <mark style="color:red;">`Required`</mark>\
  Specifies the name of the column to insert the column.
* **Workbook:** [`Object Argument`](https://docs.visualyze.ai/getting-started/rpa-studio/arguments#types-of-arguments)  <mark style="color:red;">`Required`</mark>\
  Specifies the [DriveItem ](https://docs.microsoft.com/en-us/graph/api/resources/driveitem?view=graph-rest-1.0)of the Excel workbook that contains the table in which the specified column is to be inserted. We can also specify the output variable of the [Find Files And Folders](https://docs.visualyze.ai/integrations/office-365/activities/files/find-files-and-folders) activity (which is **First** or **Results**) directly as input in this property or use the output variable of the [Create Workbook](https://docs.visualyze.ai/integrations/office-365/activities/excel/create-workbook) activity (**Workbook**). If we are using the **Results** property of the **Find Files And Folders** activity then we can directly specify the element in the array.\
  For example : Results\[1].
* **Position:** [`Object Argument`](https://docs.visualyze.ai/getting-started/rpa-studio/arguments#string)\
  Specifies the relative position of the new column. If the field is left **blank** or if the specified value is greater than the index of the last column, the new column is added to the end and if the specified value is 0 then the column is added to the front.
* **Column Values:** [`DataTable Variable`](https://docs.visualyze.ai/getting-started/rpa-studio/variables#datatable) <mark style="color:red;">`Required`</mark>\
  Specifies the values that are to be added in the new column as a **DataTable** containing a single column.


---

# Agent Instructions: 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:

```
GET https://docs.visualyze.ai/integrations/office-365/activities/excel/insert-column.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
