# Using the O365 Excel integration in a metric

This guide explains how to use the Excel (Office 365) integration to create a metric in Smaply. After setting up the integration, you can map your Excel spreadsheet data to a metric and visualize it as a chart.

<figure><img src="/files/viyIq6Xwv5Qivlo3sLNp" alt=""><figcaption></figcaption></figure>

### Step 1: Add a Metric

1. Navigate to the **Metrics** section in Smaply.
2. Click **Add Metric**.
3. Enter a descriptive **Name** for your metric (e.g., "Employee Salary").

### Step 2: Select Excel as the Data Source

1. In the **Source** dropdown, select **Excel (Office 365)**.
2. Choose the metric **Type** (e.g., Series).

### Step 3: Select Your Excel File and Sheet

1. Click **Change** to select an Excel file from your connected Office 365 account.
2. Select the relevant **Sheet** from the file.
3. (Optional) Check **Make top row headers** if your data has labeled columns in the first row.

### Step 4: Map Data Fields

1. **Data Label:** Choose the column that represents the category or labels for your metric (e.g., "Full Name").
2. **Data Values:** Select the numerical column that you want to use for the chart visualization (e.g., "Annual Salary").
3. (Optional) **Select bottom rows** if you want to pull data from the bottom of the sheet instead of the top. For example, selecting 10 rows from a sheet with 1,000 rows will take the last 10 instead of the first 10.
4. (Optional) **Number of rows:** Specify how many rows of data should be included (maximum of 50).

### Step 5: Finalize and Save

1. Review your selections to ensure the correct data mapping.
2. Click **Save** to generate the metric.
3. Your metric will now be visualized based on the selected data.

### Troubleshooting

* **No data appearing?** Ensure that the selected Excel sheet contains the correct headers and data.
* **Incorrect values displayed?** Verify that numeric data is mapped under **Data Values**.
* **Can't connect to Excel?** Check your Office 365 authentication and permissions.


---

# 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://helpdesk.smaply.app/integrations/metrics-tools/office-365-excel/using-the-o365-excel-integration-in-a-metric.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.
