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

# Microsoft 365 Email Select Configuration

> Retrieve records from Microsoft 365 Email and use them to generate Arc messages in the flow.

The Select action retrieves data from Microsoft 365 Email and brings it into CData Arc.

## Tables and Columns

Once you have configured and tested your connection, click the **Action** tab. Ensure the **Action** dropdown is set to **Select**. Click **Add Table Structure** to define your tables and columns.

Choose a **Structure Type**. The structure type determines how the connector queries Microsoft 365 Email. The available structure types are:

<ul><li>[Parent and Child Tables](#parent-and-child-tables): The connector queries tables using a parent-child hierarchy. You can add additional tables as child tables or by using multiple connectors in your flow.</li>
<li>[Joined Tables](#joined-tables): The connector issues a single JOIN query that combines data from two or more related tables.</li></ul>

The structure types are described in the following sections.

> [!NOTE]
>
> Joined Tables issues a single query to Microsoft 365 Email, which is more efficient than the Parent and Child Tables approach for data sources that enforce API rate limits.

### Parent and Child Tables

Use the dropdown list to select a target table from Microsoft 365 Email.

![Dropdown for selecting a target table in the source structure editor](https://docs.arc.cdata.com/26.4/images/dbsa_select_tableadd_263.png)

Use the arrow to add child tables to your structure. The following image shows Bill selected as the parent table, and a child table ready to be selected. When you have finished with your selections, click **Apply**.

![Table list with Bill selected as the parent table and a child table ready to be selected](https://docs.arc.cdata.com/26.4/images/dbsa_tablelist_263.png)

#### Results

After you click **Apply**, an **Items** node appears in the results structure. To configure the columns and filters for your query, click the ellipsis (**...**) on the table name node and choose **Table Settings**.

The **Edit \[table name] Settings** dialog opens with two tabs: **Columns** and **Filters**.

![Edit table Settings dialog showing the Columns tab with source table tags](https://docs.arc.cdata.com/26.4/images/dbsa_join_results.png)

In the **Columns** tab, all columns from the selected tables are listed. Each column displays a tag indicating its source table. By default, all columns are selected. Uncheck a column to exclude it from the query output.

> [!NOTE]
>
> You can select more tables by clicking the link to your **Source** table name and returning to **Edit Source Structure** pane. See [Child Tables](https://docs.arc.cdata.com/26.4/self-hosted/en/connectors/ms365email/ms365email-ac.md#child-tables) for more information.

At the bottom of the **Columns** tab, use the **Order by** field to sort the output by a column, and choose **ASC** (ascending) or **DESC** (descending) order.

The **Filters** tab lets you add filters to limit the rows the connector selects. See [Filters](#filters) for more information.

#### Options

The **Options** panel on the right side of the **Edit Source Structure** dialog contains settings that control how the connector processes records. These settings are available alongside the table designer and apply to the entire query.

<ul><li>**Only process new or changed records**: Enables incremental processing so that the connector only selects rows that are new or changed since the last run.</li>
<li>**Update \[column] with \[value] when rows are processed**: Updates a column with a specified value after each row is processed.</li></ul>

You can also preview the output structure or view the underlying XML configuration by toggling **Preview XML** or **Code View** at the top of the **Edit Source Structure** dialog.

### Joined Tables

When you select **Joined Tables** as the structure type, the JOIN designer appears. Use the JOIN designer to define how tables in Microsoft 365 Email relate to each other. The connector translates your configuration into a single JOIN query.

![JOIN designer with empty join row fields](https://docs.arc.cdata.com/26.4/images/dbsa_join_designer.png)

Each row in the JOIN designer represents one join relationship and contains the following fields:

<ul><li>**Join Type**: The type of SQL join to perform. The available options depend on what Microsoft 365 Email supports. Common options include **Inner Join**, **Left Join**, **Right Join**, and **Full Outer Join**.</li>
<li>**Left Table**: The table on the left side of the join. The first join row's left table is the base table for the query.</li>
<li>**Left Column**: The column from the left table to join on.</li>
<li>**Right Table**: The related table on the right side of the join.</li>
<li>**Right Column**: The column from the right table that matches the left column.</li></ul>

The following example joins a **Bill** table to a **Bill1** table on their shared **Id** column:

![JOIN designer with Bill and Bill1 tables joined on the Id column](https://docs.arc.cdata.com/26.4/images/dbsa_join_addtable.png)

This produces a query equivalent to:

```sql theme={null}
SELECT ... FROM Bill INNER JOIN Bill1 ON Bill.Id = Bill1.Id
```

To join more than two tables, click **Add Join** to add another join row. Each additional row joins a new table to the result of the previous join.

When you are done configuring the join, click **Apply**.

#### Results

After you click **Apply**, a **Results** node appears in the results structure. To configure the columns and filters for your join output, click the ellipsis (**...**) on the Results node and choose **Results Settings**.

The **Edit Results Settings** dialog opens with two tabs: **Columns** and **Filters**.

![Edit Results Settings dialog showing the Columns tab with source table tags](https://docs.arc.cdata.com/26.4/images/dbsa_join_results.png)

In the **Columns** tab, all columns from all joined tables are listed. Each column displays a tag indicating its source table. By default, all columns are selected. Uncheck a column to exclude it from the query output.

> [!NOTE]
>
> When two joined tables share a column name, the connector automatically prefixes the duplicate column with its table name to avoid collisions.

At the bottom of the **Columns** tab, use the **Order by** field to sort the output by a column, and choose **ASC** (ascending) or **DESC** (descending) order.

The **Filters** tab lets you add filters to limit the rows the connector selects. See [Filters](#filters) for more information.

#### Options

The **Options** panel on the right side of the **Edit Source Structure** dialog contains settings that control how the connector processes records. These settings are available alongside the JOIN designer and apply to the entire join query.

<ul><li>**Use column \[x] for processing new or changed records**: Enables incremental processing so that the connector only selects rows that are new or changed since the last run. In a Joined Tables configuration, this column must come from the base (leftmost) table. Columns from joined tables are not available for this setting.</li>
<li>**Update \[column] with \[value] when rows are processed**: Updates a column with a specified value after each row is processed.</li></ul>

You can also preview the output structure or view the underlying XML configuration by toggling **Preview XML** or **Code View** at the top of the **Edit Source Structure** dialog.

## Receive Filters

The following filters appear on the [**Advanced** tab](https://docs.arc.cdata.com/26.4/self-hosted/en/connectors/ms365email/ms365email.md#advanced-tab) and restrict which messages the connector retrieves on each poll.

<table><thead><tr><th>Setting</th><th>Description</th></tr></thead>
<tbody><tr><td>**Read State**</td><td>Restricts the messages retrieved to only unread or only read messages. Defaults to **Any**.</td></tr>
<tr><td>**Importance**</td><td>Restricts the messages retrieved to a single importance level. Defaults to **Any**.</td></tr>
<tr><td>**Attachments**</td><td>Restricts the messages retrieved to those with or without attachments. Defaults to **Any**.</td></tr>
<tr><td>**Category**</td><td>Restricts the messages retrieved to those stamped with the specified Outlook category. Leave empty to receive messages regardless of category.</td></tr>
<tr><td>**Conversation Id**</td><td>Restricts the messages retrieved to a single conversation thread. Each received message carries its conversation Id in the `Microsoft365Email-Conversation-Id` header, which is where this value comes from.</td></tr>
<tr><td>**Subject**</td><td>Restricts the messages retrieved to those whose subject contains the specified value. Leave empty to receive messages regardless of subject.</td></tr>
<tr><td>**Sender**</td><td>Restricts the messages retrieved to those sent from the specified email address. The address must match in full; a partial address or bare domain matches nothing. Leave empty to receive messages from any sender.</td></tr>
<tr><td>**Max Messages**</td><td>The maximum number of messages to retrieve in a single poll. Messages are retrieved oldest first, so remaining messages are picked up on the following poll. Defaults to **50**.</td></tr>
<tr><td>**Days To Search**</td><td>The number of days to look back when searching for messages. Defaults to **7**. When set to 0, no date limit is applied. When **Only Process New Messages** is enabled, this value is used only as a fallback when no prior receive watermark is available.</td></tr>
<tr><td>**Only Process New Messages**</td><td>When enabled (the default), the connector tracks the last message received and will not re-download it on subsequent polls. The connector uses a stored watermark as the primary date filter and falls back to **Days To Search** when the watermark is unavailable. When disabled, every poll retrieves messages within the **Days To Search** window without tracking state.</td></tr></tbody></table>

## Post-Receive Action

The following settings appear on the [**Advanced** tab](https://docs.arc.cdata.com/26.4/self-hosted/en/connectors/ms365email/ms365email.md#advanced-tab) and control what happens to each message in the mailbox after it has been successfully retrieved.

<table><thead><tr><th>Setting</th><th>Description</th></tr></thead>
<tbody><tr><td>**After Receiving**</td><td>What to do with each message in the mailbox once it has been successfully retrieved. Options are **None** (the default), **Mark As Read**, **Apply Category**, and **Move To Folder**. Applying a category or moving the message avoids deleting mail from the source mailbox.</td></tr>
<tr><td>**Category Name**</td><td>The Outlook category applied to each retrieved message, for example `Arc-Processed`. The category must already exist in the mailbox. Visible when **After Receiving** is set to **Apply Category**.</td></tr>
<tr><td>**Destination Folder**</td><td>The mail folder that retrieved messages are moved into. Accepts a folder display name or a well-known folder name. Visible when **After Receiving** is set to **Move To Folder**.</td></tr></tbody></table>

## Filters

You can optionally add filters to limit the data the connector selects. Click the **Filters** tab in the settings dialog to configure filters. The connector translates your filters into query syntax.

> [!NOTE]
>
> You do not need to apply a filter to your data if it does not suit your use case.

### Creating a Filter

To create a filter, follow these steps:

<ol><li>Click **Add Filter**.</li>
<li>In the column dropdown, choose the column that you want to filter.</li>
<li>In the condition dropdown, choose the filtering condition. The available conditions depend on the data type of the column you selected. For example, a numeric column has the condition **Less Than or Equal To**, whereas a string column has **Contains**.</li>
<li>Enter a value in the value field. If the condition does not require a value (for example, **Is Null**), the value field is not shown.</li></ol>

The image below shows an example of a filter on a column named **Vendor**. With this filter in place, the connector only selects rows where the **Vendor** column contains **CData**.

![Filter configured on the Vendor column with Contains CData condition](https://docs.arc.cdata.com/26.4/images/dbsa_filter.png)

### Filter Groups

You can apply multiple filters by clicking **Add Filter** and creating more filters. All filters belong to the same group by default. Click **Add Group** to create a nested group and separate filters by different logic.

Each group has the following options at the top:

<ul><li>**NOT** toggle: Inverts the logic of the entire group. For example, toggling NOT on a group that contains **Amount Less Than or Equal To 5000** instructs the connector to select only rows where the amount is greater than 5000.</li>
<li>**And / Or** toggle: Determines how this group relates to adjacent filters or groups.
<ul><li>If you select **And**, this group's condition must be true in addition to adjacent conditions.</li>
<li>If you select **Or**, this group's condition is an alternative to adjacent conditions.</li></ul></li></ul>

The screenshot below shows an example with multiple filter groups.

![Multiple filter groups showing AND and OR logic](https://docs.arc.cdata.com/26.4/images/dbsa_filter_group.png)

In this example, the filter condition is met when all of the following are true:

<ul><li>The **Vendor** column contains **CData**</li>
<li>The **Status** column equals **Active** or **Pending**</li>
<li>The **Amount** column is *not* less than or equal to **5000** (that is, Amount is greater than 5000)</li></ul>

If this filter condition is met, the connector selects the matching data and passes it down the flow.

## Example Arc Flow

After you choose the tables and columns for the Select-configured Microsoft 365 Email connector, place the connector at the beginning of an Arc flow. The screenshot below depicts an example flow with a Microsoft 365 Email Select connector, an XML Map connector, a CSV connector, and a File connector at the end:

![](https://docs.arc.cdata.com/26.4/images/ms365email_xmlflow_select.png)

Data in this example flow passes through these steps:

<ol><li>The **Microsoft 365 Email\_Select** connector pulls data from a Microsoft 365 Email connection.</li>
<li>This data passes to the **XML\_Map** connector as the **Source File**, which maps to the **Source** tree.</li>
<li>Data from the **CSV1** connector passes to the **XML\_Map** connector as the **Destination File**, which maps to the **Destination** tree.
![](https://docs.arc.cdata.com/26.4/images/dbsa_xmlmap_select.png)</li>
<li>The **XML\_Map** connector attempts to automatically map **Source** elements to **Destination** elements with the same name. You can manually change these and fill in blank mappings by dragging elements from **Source** to **Destination**.
![](https://docs.arc.cdata.com/26.4/images/dbsa_xmlmap_elements.png)</li>
<li>The file from **CSV1** that has been modified with data from **Microsoft 365 Email\_Select** then passes down the flow from **CSV1**.</li></ol>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.