# Excel Generator

1 min read

**The service is integrated into the following modules:**

- [Question Answerer](https://docs.unique.ai/administrators/space-management/create-spaces/unique-custom-space/add-ai-assistant-and-modules/question-answerer)

- [Question Extractor](https://docs.unique.ai/administrators/space-management/create-spaces/unique-custom-space/add-ai-assistant-and-modules/question-extractor)

# Functionality

The **Excel Generator Service** enables developers to easily convert a pandas data frame to a nicely formatted Excel File. It is used as part of a **tool** or **module**.

This service is built on top of the [xlsxwriter library](https://xlsxwriter.readthedocs.io/).

# Configuration

## Default Configuration

json

```
{
    "uploadSuffix": "_answers.docx",
    "uploadScopeId": null,
    "uploadToChat": true,
    "renameColMap": null,
    "tableHeaderFormat": {
        "bg_color": "#966919",
        "bold": true,
        "font_color": "white",
        "text_wrap": true
    },
    "tableDataFormat":{
        "bg_color": "#FFFFFF",
        "bold": false,
        "font_color": "black",
        "text_wrap": true,
        "border": 1,
        "valign": "top"
    }
}
```

| **Field Name**      | **Description**                                                                                                                                                                                                                         | **Type** | **Default Value** | **Required** |
|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|-------------------|--------------|
| `uploadSuffix`      | The suffix of the generated Excel file.                                                                                                                                                                                                   | string   | `_answer.docx`    | No           |
| `uploadScopeId`     | The scope id into which the generated docx file is uploaded.                                                                                                                                                                          | string   | `null`             | No           |
| `uploadToChat`      | Whether to upload the generated file to the chat.                                                                                                                                                                                      | boolean  | `true`             | No           |
| `renameColMap`      | This setting lets you rename columns when exporting data.<br>By default, a column might be exported with a name like `old_name`, but if you want it to appear as something like "New Name", you can use this parameter to customize it.<br>Example **:** To rename `old_name` to `New Name`, set the parameter like this:<br>json<br>```<br>{<br>  "old_name": "New Name"<br>}<br>``` | dict     | `null`             | No           |
| `tableHeaderFormat`  | The `tableHeaderFormat` setting lets you customize how table headers look in exported files.<br>It accepts a dictionary of style options, where you can define things like:<br>- Background color<br>  <br>- Font size and color<br>  <br>- Bold text<br>  <br>- Text wrapping<br>  <br>These style options follow the rules of the `xlsxwriter` library. | dict     | json<br>```<br>{<br>  "bg_color": "#966919",<br>  "bold": true,<br>  "font_color": "white",<br>  "text_wrap": true,<br>}<br>``` | No           |
| `tableDataFormat`   | The `tableDataFormat` setting lets you customize how data cells appear in exported files.<br>It accepts a dictionary of style settings, where you can control things like:<br>- Background color<br>  <br>- Font color and boldness<br>  <br>- Text wrapping<br>  <br>- Cell borders and vertical alignment<br>  <br>These style options follow the rules of the `xlsxwriter` library. | dict     | json<br>```<br>{<br>  "bg_color": "#FFFFFF",<br>  "bold": false,<br>  "font_color": "black",<br>  "text_wrap": true,<br>  "border": 1,<br>  "valign": "top"<br>}<br>``` | No           |
