> ## 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 Connector Setup

> Connect Arc to Microsoft 365 Email for data integration and synchronization

The Microsoft 365 Email connector lets you send and receive email through the Microsoft Graph API using the CData Office365 driver. Unlike the [Email Send](https://docs.arc.cdata.com/26.4/self-hosted/en/connectors/email-send.md) and [Email Receive](https://docs.arc.cdata.com/26.4/self-hosted/en/connectors/email-receive.md) connectors, which support SMTP and IMAP for accounts such as Gmail, Yahoo, and on-premises Exchange, this connector is designed specifically for Microsoft 365 and supports app-only authentication for shared and departmental mailboxes.

## Key Capabilities

* App-only authentication for shared and departmental mailboxes, using Azure Service Principal credentials without per-user OAuth consent
* Outlook categories as non-destructive processing markers: stamp received messages with a server-side category and filter on it in subsequent polls instead of deleting or moving them
* Rich server-side receive filters on folder, read status, importance, attachments, and received date, plus client-side filtering on Outlook categories
* Send on behalf of or as another user or shared mailbox, with proper Microsoft Graph permissions
* Full folder management: create processing folders, move messages after receive, or query folders by name or Id

Follow the steps below to connect Arc to Microsoft 365 Email.

## Establish a Connection

To allow Arc to use data from Microsoft 365 Email, you must first establish a connection. There are two ways to do this:

* Add a Microsoft 365 Email connector to your flow. Then, in the settings pane, click **Create** next to the Connection drop-down list.
* Open the Arc **Settings** page, then open the **Connections** tab. Click **Add**, select **Microsoft 365 Email**, and click **Next**.

> [!NOTE]
>
> * The login process is only required the first time the connection is created.
> * Connections to Microsoft 365 Email can be reused across multiple Microsoft 365 Email connectors.

Follow these steps to finish creating your connection:

1. Enter the following connection information in the **Add Connection** modal:

   * **Name**: The static name of the connection. Set a name of your choice.
   * **Type**: The connector name. This field is always set to Microsoft 365 Email.
   * **Auth Scheme**: The authentication scheme to use. Options are **AzureAD**, **AzureMSI**, **AzureServicePrincipal** (the default), and **AzureServicePrincipalCert**. See [Authentication Schemes](#authentication-schemes) for details on each scheme and its required fields.
   * **Default Groups**: The default group context when accessing group-scoped resources in Microsoft Office 365.
   * **Default User**: The default user context when accessing user-scoped resources in Microsoft Office 365.
   * **Message Content Type**: Whether to return message bodies in HTML format or as plain text.
   * **Group Id**: The Id of a Microsoft Office 365 group whose data you want to access. Optional.
   * **User Principal Name (UPN)**: The UPN or object Id of the mailbox this connector acts on, for example `support@xyzcorp.com`. Required for app-only schemes (AzureServicePrincipal, AzureServicePrincipalCert, and AzureMSI). Leave empty when using AzureAD to act on the signed-in user's own mailbox.

2. Enter any additional fields required for your chosen auth scheme. See [Authentication Schemes](#authentication-schemes) below.

3. Click **Connect** (AzureAD only) or **Test Connection** (all other schemes) to verify that Arc can connect with the provided information. If an error occurs, check all fields and try again.

4. Click **Add Connection** to finalize the connection.

5. Select the newly created connection from the **Connection** drop-down list on the **Settings** tab.

6. Click **Save Changes**.

## Authentication Schemes

The app-only schemes (AzureServicePrincipal, AzureServicePrincipalCert, and AzureMSI) require an application registration in the [Microsoft Entra admin center](https://entra.microsoft.com). The registration must be granted the **Mail.ReadWrite** and **Mail.Send** application permissions, both with tenant admin consent, before Arc can connect. Mail.ReadWrite covers Receive, the post-receive actions, and folder lookups; Mail.Send covers Send. Mail.Read is sufficient in place of Mail.ReadWrite only if you never use the post-receive actions. AzureAD uses delegated permissions and requires a redirect URI in the registration instead.

### AzureAD

Delegated user authentication. The user signs in through a browser and grants access; tokens are stored and refreshed automatically. Use this scheme to act on the signed-in user's own mailbox. Leave **User Principal Name (UPN)** empty when using this scheme.

No additional fields beyond the common fields above are required. After entering them, click **Connect**. A new browser tab opens for signing into your Microsoft account. Log in, grant the requested permissions, and return to Arc.

### AzureMSI

Managed Service Identity authentication for Arc instances running on Azure infrastructure (virtual machines, App Service, or AKS pods with workload identity). The connector acquires a token from the host's managed identity automatically, without requiring credentials. Set **User Principal Name (UPN)** to the mailbox you want to access.

No additional fields beyond the common fields above are required.

### AzureServicePrincipal

Application-only authentication using a client secret. Does not require per-user OAuth consent, making it suitable for shared and departmental mailboxes. Set **User Principal Name (UPN)** to the mailbox you want to access.

**OAuth**

* **Azure Tenant** (required): The Id or primary domain of the Microsoft Entra tenant that contains the mailbox, for example `contoso.onmicrosoft.com`.
* **OAuth Client Id** (required): The client Id assigned to your Azure AD app registration.
* **OAuth Client Secret**: The client secret assigned to your Azure AD app registration.

### AzureServicePrincipalCert

Application-only authentication using a certificate instead of a client secret. Use this scheme when your organization requires certificate-based credentials. Set **User Principal Name (UPN)** to the mailbox you want to access.

**OAuth**

* **Azure Tenant** (required): The Id or primary domain of the Microsoft Entra tenant that contains the mailbox, for example `contoso.onmicrosoft.com`.
* **OAuth Client Id** (required): The client Id assigned to your Azure AD app registration.

**JWT OAuth**

* **OAuth JWT Cert**: The certificate to use for signing JWT assertions.
* **OAuth JWT Cert Password**: The password for the OAuth JWT certificate.
* **OAuth JWT Cert Subject**: Identifies the subject of the OAuth JWT certificate used to locate a matching certificate in the store. Supports partial matches and the wildcard `*` to select the first certificate.

## Select an Action

After establishing a connection to Microsoft 365 Email, you must choose the action that the Microsoft 365 Email connector will perform. The table below outlines each action and where it belongs in an Arc flow.

| Action | Description | Position in Flow |
| - | - | - |
| [Upsert](https://docs.arc.cdata.com/26.4/self-hosted/en/connectors/ms365email/ms365email-upsert.md) | Inserts or updates Microsoft 365 Email data. By default, if a record already exists in Microsoft 365 Email, an update is performed on the existing data in Microsoft 365 Email using the values provided from the input. | End |
| [Lookup](https://docs.arc.cdata.com/26.4/self-hosted/en/connectors/ms365email/ms365email-lookup.md) | Retrieves values from Microsoft 365 Email and inserts those values into an already-existing Arc message in the flow. The **Lookup Query** determines what value the connector will retrieve from Microsoft 365 Email. It should be formatted as a SQL query against the Microsoft 365 Email tables. | Middle |
| [Lookup Stored Procedure](https://docs.arc.cdata.com/26.4/self-hosted/en/connectors/ms365email/ms365email-lsp.md) | Treats data coming into the connector as input for a stored procedure, then inserts the result into an existing Arc message in the flow. You can click the **Show Sample Data** button in the **Test Lookup** modal to provide sample inputs to the selected Stored Procedure and preview the results. | Middle |
| [Select](https://docs.arc.cdata.com/26.4/self-hosted/en/connectors/ms365email/ms365email-select.md) | Retrieves data from Microsoft 365 Email and brings it into Arc. You can use the **Filter** panel to add filters to the Select. These filters function similarly to *WHERE* clauses in SQL. | Beginning |
| [Execute Stored Procedures](https://docs.arc.cdata.com/26.4/self-hosted/en/connectors/ms365email/ms365email-esp.md) | Treats data coming into the connector as input for a stored procedure, then passes the result down the flow. You can click the **Show Sample Data** button in the **Test Execute Stored Procedure** modal to provide sample inputs to the selected Stored Procedure and preview the results. | Middle |
| [Receive](https://docs.arc.cdata.com/26.4/self-hosted/en/connectors/ms365email/ms365email-receive.md) | Receives email from a Microsoft 365 mailbox and passes it down the flow. | Beginning |
| [Send](https://docs.arc.cdata.com/26.4/self-hosted/en/connectors/ms365email/ms365email-send.md) | Sends messages from the flow as email through Microsoft 365. | End |

## Advanced Tab

### AI

<table><thead><tr><th>Setting</th>
<th>Description</th></tr></thead>
<tbody><tr><td>**Customize AI Prompts**</td>
<td>Only visible when **Mapping** is enabled on the **Action** tab. Check this to override the default System Prompt and User Prompt content that the AI-assisted mapping uses to create the mappings between the source and destination documents. When unchecked, the connector uses the default prompts to generate the mappings. The default prompts are shown in the text boxes when the checkbox is enabled for the first time.</td></tr></tbody></table>
![Customize AI Prompts settings](https://docs.arc.cdata.com/26.4/images/customize_ai_prompts.png)

### Advanced Settings

*Advanced settings* are specific to the Microsoft 365 Email connector and the CData Office365 driver it relies on. Some settings only appear based on the selected action; see the documentation page for the action you are configuring for details.

| Setting | Description |
| - | - |
| **Log Modules** | Specifies the core modules to include in the log file. Use a semicolon-separated list of module names. By default, all modules are logged. |
| **Location** | Specifies the location of a directory containing schema files that define tables, views, and stored procedures. Depending on your service's requirements, this can be expressed as either an absolute path or a relative path. |
| **Browsable Schemas** | Optional setting that restricts the schemas reported to a subset of all available schemas. For example, `BrowsableSchemas=SchemaA,SchemaB,SchemaC`. |
| **Tables** | Optional setting that restricts the tables reported to a subset of all available tables. For example, `Tables=TableA,TableB,TableC`. |
| **Views** | Optional setting that restricts the views reported to a subset of the available tables. For example, `Views=ViewA,ViewB,ViewC`. |
| **Reset Schema** | Resets the cached schema, forcing the connector to retrieve fresh schema information from Microsoft Office 365 on the next operation. |
| **Reset History** | Resets the cache stored when **Use column *columnname* for processing new or changed records** is checked. |
| **Directory Retrieval Depth** | Specifies how far down a table's subdirectories should be scanned to retrieve results. If not explicitly set, the driver uses a depth of 5 sublevels below the root (default). |
| **Max Rows** | Specifies the maximum number of rows returned for queries that do not include either aggregation or GROUP BY. |
| **Other Driver Settings** | Specifies advanced connection properties for specialized scenarios. Use this property only under the guidance of our Support team to address specific issues. |
| **Pagesize** | Specifies the maximum number of records per page the provider returns when requesting data from Microsoft Office 365. |
| **Pseudocolumns** | Specifies the pseudocolumns to expose as table columns, expressed as a string in the format `TableName=ColumnName;TableName=ColumnName`. |
| **Timeout** | Specifies the maximum time, in seconds, that the provider waits for a server response before throwing a timeout error. |
| **Use Client Side Paging** | Toggles the CData ADO.NET Provider for Microsoft Office 365's use of client-side paging. When enabled, the connector retrieves all messages reliably but also returns calendar event messages alongside email; messages where `IsEventMessage` is true are automatically excluded from email results. |
| **User Defined Views** | Specifies a filepath to a JSON configuration file that defines custom views. The provider automatically detects and uses the views specified in this file. |
| **Command Timeout** | The command execution timeout duration in seconds. |
| **Output File Format** | The format in which output data is represented. The default value (XML) causes the connector to output an XML file for every record that is processed, while optionally combining multiple records into a single data structure (depending on the value of **Max Records**). The CSV and TSV options output data in their respective file formats. This option is not available for complex table structures that include child tables. |
| **Process Changes Interval Unit** | Applicable to Select action only. When **Use column *columnname* for processing new or changed records** is checked in the **Advanced** portion of the **Select Configuration** section of the **Settings** tab, this controls how to interpret the **Process Changes Interval** setting (for example, Hours, Days, or Weeks). See [Only Process New or Changed Records](https://docs.arc.cdata.com/26.4/self-hosted/en/connectors/ms365email/ms365email-ac.md#only-process-new-or-changed-records) for details on this and the following two settings. |
| **Process Changes Interval** | When **Use column *columnname* for processing new or changed records** is checked on the **Select Configuration** section of the **Settings** tab, this controls how much historical data Arc attempts to process on the first attempt. For example, keeping the default of 180 (Days) means Arc only attempts to process data that has been created or modified in the last 180 days. |
| **Lookup Caching** | When enabled, queries are performed against a local cache before they are executed directly against the data source (when no records are returned from the cache). When disabled (the default), queries are performed directly against the data source. |
| **Local File Scheme** | A scheme for assigning filenames to messages that are output by the connector. You can use macros in your filenames dynamically to include information such as identifiers and timestamps. For more information, see [Macros](#macros). |
| **Auto Truncate** | When enabled, the connector automatically truncates any string or binary column values that are longer than the allowed limit. |
| **Max Failed Records** | The maximum number of records that are allowed to fail during insertion to allow processing to continue. The default value of 0 means that any errors cause the input message to be marked as an Error, and any uncommitted transactions are rolled back. A value of -1 means that all errors are ignored and the connector continues attempting to insert subsequent records. A positive value means that the connector continues attempting to insert records until the threshold is reached. |
| **Last Inserted Id Query** | Provide a query to execute to retrieve the auto-increased Id for the last inserted record. |
| **Process Changes Start Date** | When **Use column *columnname* for processing new or changed records** is checked on the **Select Configuration** section of the **Settings** tab, this controls the start date of the data to retrieve. |
| **Insert Empty** | When left unchecked (the default), the connector skips empty XML elements when building INSERT and UPDATE statements. This causes the database to use the default column value for INSERT statements, and for column values to remain unchanged for UPDATE statements. When checked, the connector includes empty XML elements in INSERT and UPDATE statements, using an empty string as the value for the column. |
| **Insert Null** | When left unchecked (the default), the connector skips null XML elements (indicated by the `xsi:nil="true"` attribute) when building INSERT and UPDATE statements. This causes the database to use the default column value for INSERT statements, and for column values to remain unchanged for UPDATE statements. When checked, the connector includes null XML elements in INSERT and UPDATE statements, using null as the value for the column. The cases which are treated as null are: `Not exist`, `<element/>`, `<element xsi:nil="true"/>`, `<element xsi:nil="true"></element>`, `<element null="true"/>`, and `<element null="true"></element>`. |
| **Batch Input Size** | The maximum number of queries in a batch if batches are supported by the data source. |
| **Max Records** | The maximum number of records to include in a single output message. Use -1 to indicate that all output records should be put in a single file, and use 0 to indicate that the connector can decide based on the configured **Output File Format**. By default, XML outputs one record per file, and flat file formats include all records in one file. |
| **Transaction Size** | The maximum number of queries in a transaction. |
| **Batch Size** | The maximum number of batch messages in a batch group. |
| **Processing Delay** | The amount of time (in seconds) by which the processing of files placed in the Input folder is delayed. This is a legacy setting. Best practice is to [use a File connector](https://docs.arc.cdata.com/26.4/self-hosted/en/flows/designing-a-flow.md#interacting-with-the-local-file-system) to manage local file systems instead of this setting. |
| **Log Level** | The verbosity of logs generated by the connector. When you request support, set this to **Debug**. |
| **Log Subfolder Scheme** | Instructs the connector to group files in the `Logs` folder according to the selected interval. For example, the **Weekly** option instructs the connector to create a new subfolder each week and store all logs for the week in that folder. The blank setting tells the connector to save all logs directly in the `Logs` folder. For connectors that process many transactions, using subfolders can help keep logs organized and improve performance. |
| **Log Messages** | When checked, the connector keeps a copy of the message next to the logs for the message in the Logs directory. If you disable this, you might not be able to download a copy of the file from the **Input** or **Output** tabs. |

### Miscellaneous

*Miscellaneous settings* are for specific use cases.

| Setting | Description |
| - | - |
| **Other Settings** | Enables you to configure hidden connector settings in a semicolon-separated list (for example, `setting1=value1;setting2=value2`). Normal connector use cases and functionality should not require the use of these settings. |

## Automation Tab

### Automation Settings

*Settings related to the automatic processing of files by the connector.*

| Setting | Description |
| - | - |
| **Send** | Whether files arriving at the connector are automatically sent. |
| **Retry Interval** | The number of minutes before a failed send is retried. |
| **Max Attempts** | The maximum number of times the connector processes the file. Success is measured based on a successful server acknowledgement. If you set this to 0, the connector retries the file indefinitely. |
| **Receive** | Whether the connector should automatically query the data source. |
| **Interval** | The interval between automatic query attempts. |
| **Minutes Past the Hour** | The minutes offset for an hourly schedule. Only applicable when the interval setting above is set to *Hourly*. For example, if this value is set to 5, the automation service downloads at 1:05, 2:05, 3:05, etc. |
| **Time** | The time of day that the attempt should occur. Only applicable when the interval setting above is set to *Daily*, *Weekly*, or *Monthly*. |
| **Day** | The day on which the attempt should occur. Only applicable when the interval setting above is set to *Weekly* or *Monthly*. |
| **Minutes** | The number of minutes to wait before attempting the download. Only applicable when the interval setting above is set to *Minute*. |
| **Cron Expression** | A five-position string representing a cron expression that determines when the attempt should occur. Only applicable when the interval setting above is set to *Advanced*. |
| **Start Date and Time** | The date and time at which the automation first runs. Every run after that follows the interval setting above. The last and next run times appear in the [Automation Status](#automation-status) section. |

### Automation Status

*A read-only summary of whether the automation is running, what happened on the last run, and when the next run occurs.*

The **Automation Status** card appears under the **Enabled** checkbox on the **Automation** tab for **Receive**, **Download**, and **Scheduled Send** automation. The card answers three questions: whether the automation ran, whether the run worked, and when the next run occurs.

The card updates as you change the **Enabled** checkbox, or the **Interval** or **Start Date and Time** settings, before you save the connector.

![The Automation Status card on the Automation tab showing a Suspended status, a Failed last processed result, and the next run time](https://docs.arc.cdata.com/26.4/images/automation-status-card.png)

Status

The current state of the automation for the connector.

<table><thead><tr><th>Status</th>
<th>Description</th></tr></thead>
<tbody><tr><td>**In Progress**</td>
<td>A run is executing now, or another instance has locked the scheduled slot.</td></tr>
<tr><td>**Idle**</td>
<td>The automation is waiting for the next scheduled run.</td></tr>
<tr><td>**Suspended**</td>
<td>The connector is in a [backoff](https://docs.arc.cdata.com/26.4/self-hosted/en/connectors/connector-backoff.md) state after repeated failed runs, and the automation service is skipping it.</td></tr>
<tr><td>**Disabled**</td>
<td>The automation is turned off for the connector.</td></tr></tbody></table>

Last Run Time

The outcome of the most recent run.

<table><thead><tr><th>Field</th>
<th>Description</th></tr></thead>
<tbody><tr><td>**Date**</td>
<td>The scheduled time of the last run.</td></tr>
<tr><td>**Last Processed Start**</td>
<td>The time the connector actually started processing the last run. This can be slightly later than the scheduled time.</td></tr>
<tr><td>**Last Processed Result**</td>
<td>The outcome of the last run:
<ul><li>**Successful**: The run completed and processed data.</li>
<li>**No Data**: The run completed but there was nothing to process, such as a query that returned no rows.</li>
<li>**Failed**: The run did not complete.</li></ul></td></tr>
<tr><td>**Last Successful At**</td>
<td>The date and time of the most recent successful run. This field appears when the last run failed or returned no data, so you can see how long the connector has gone without a successful run.</td></tr></tbody></table>

Next Run Time

The **Date** field shows when the automation is scheduled to run next. It is blank when the automation is disabled.

View Details

The **Suspended** status, the **Failed** result, and the **No Data** result each include a **View Details** link that opens a dialog with the full message:

<ul><li>**Suspended**: Lists each instance that is in backoff, how many times it failed, and when the automation service resumes. See [Connector Backoff](https://docs.arc.cdata.com/26.4/self-hosted/en/connectors/connector-backoff.md) for how a connector exits this state.</li>
<li>**Failed**: Shows the error message from the last failed run.</li>
<li>**No Data**: Shows the message the connector reported, such as `0 rows returned`.</li></ul>

No Run Versus No Data

The card distinguishes a connector that has not run from one that ran and found nothing. If **Last Processed Result** is empty, the automation has not run yet, so check the **Next Run Time** and the schedule settings. If the result is **No Data**, the automation ran on schedule and the data source returned nothing, so check the source for new data.

Disabled Connectors

A disabled connector keeps its last run information, so you can still see when it last ran and what happened. Only the **Next Run Time** is cleared.

### Performance

*Settings related to the allocation of resources to the connector.*

| Setting | Description |
| - | - |
| **Max Workers** | The maximum number of worker threads consumed from the threadpool to process files on this connector. If set, this overrides the default setting on the [Performance Settings](https://docs.arc.cdata.com/26.4/self-hosted/en/getting-started/administration/settings/performance-settings.md) portion of the [Advanced Settings](https://docs.arc.cdata.com/26.4/self-hosted/en/getting-started/administration/settings/advanced-settings.md) page. |
| **Max Files** | The maximum number of files sent by each thread assigned to the connector. If set, this overrides the default setting on the [Performance Settings](https://docs.arc.cdata.com/26.4/self-hosted/en/getting-started/administration/settings/performance-settings.md) portion of the [Advanced Settings](https://docs.arc.cdata.com/26.4/self-hosted/en/getting-started/administration/settings/advanced-settings.md) page. |

## Alerts Tab

*Settings related to configuring alerts.*

Before you can execute Service Level Agreements (SLAs), you need to set up email alerts for notifications. By default, Arc uses the global settings on the [Alerts](https://docs.arc.cdata.com/26.4/self-hosted/en/getting-started/administration/settings/alerts.md) tab. To use other settings for this connector, toggle **Override global setting** on.

By default, error alerts are enabled, which means that emails are sent whenever there is an error. To turn them off, uncheck the **Enable** checkbox.

Enter a **Subject** (mandatory), then optionally enter a comma-separated list of **Recipient** emails.

## SLAs Tab

*Settings related to configuring Service Level Agreements (SLAs).*

SLAs enable you to configure the volume you expect connectors in your flow to send or receive, and to set the time frame in which you expect that volume to be met. Arc sends emails to warn the user when an SLA is not met, and marks the SLA as *At Risk*, which means that if the SLA is not met soon, it will be marked as *Violated*. This gives the user an opportunity to step in and determine the reasons the SLA is not being met, and to take appropriate actions. If the SLA is still not met at the end of the at-risk time period, the SLA is marked as violated, and the user is notified again.

To define an SLA, toggle **Expected Volume** on, then click the **Settings** tab.

![Empty SLA configuration](https://mintcdn.com/cdata-arc/JuVWSaGlKX7avH_C/26.4/images/sla_empty.png?fit=max\&auto=format\&n=JuVWSaGlKX7avH_C\&q=85\&s=45e386d064d0de84861eae628ed1f166)

* If your connector has separate send and receive actions, use the radio buttons to specify which direction the SLA pertains to.
* In the **Expect at least** portion of the window:
  * Set the minimum number of transactions you expect to be processed (the volume)
  * Use the **Every** fields to specify the time frame
  * Indicate when the SLA should go into effect. If you choose **Starting on**, complete the date and time fields.
  * Check the boxes for the days of the week that you want the SLA to be in effect. Use the dropdown to choose **Everyday** if necessary.
* In the **Set status to 'At Risk'** portion of the window, specify when the SLA should be marked as at risk.
  * By default, notifications are not sent until an SLA is in violation. To change that, check **Send an 'At Risk' notification**.

The following example shows an SLA configured for a connector that expects to receive 1000 files every day Monday-Friday. An at-risk notification is sent 1 hour before the end of the time period if the 1000 files have not been received.

![SLA Configuration Example](https://mintcdn.com/cdata-arc/JuVWSaGlKX7avH_C/26.4/images/sla_defined.png?fit=max\&auto=format\&n=JuVWSaGlKX7avH_C\&q=85\&s=50424ba4046c10f47f4cb8a7b31892d1)

> [!NOTE]
>
> You can turn off SLA alerts if necessary. This can be useful during maintenance windows. Click **Settings** on the navbar, then navigate to **Alerts > General Alerts**. Click the tablet and pencil icon to edit, and uncheck the **SLA Alerts** setting.

## Macros

Using macros in file naming strategies can enhance organizational efficiency and contextual understanding of data. By incorporating macros into filenames, you can dynamically include relevant information such as identifiers, timestamps, and header information, providing valuable context to each file. This helps ensure that filenames reflect details important to your organization.

Arc supports these macros, which all use the following syntax: `%Macro%`.

| Macro | Description |
| - | - |
| ConnectionName | Evaluates to the connection name used by the connector. |
| ConnectorID | Evaluates to the ConnectorID of the connector. |
| Ext | Evaluates to the file extension of the file currently being processed by the connector. |
| Filename | Evaluates to the filename (extension included) of the file currently being processed by the connector. |
| FilenameNoExt | Evaluates to the filename (without the extension) of the file currently being processed by the connector. |
| MessageId | Evaluates to the MessageId of the message being output by the connector. |
| RegexFilename:*pattern* | Applies a RegEx pattern to the filename of the file currently being processed by the connector. |
| Header:*headername* | Evaluates to the value of a targeted header (`headername`) on the current message being processed by the connector. |
| LongDate | Evaluates to the current datetime of the system in long-handed format (for example, Wednesday, January 24, 2024). |
| ShortDate | Evaluates to the current datetime of the system in a yyyy-MM-dd format (for example, 2024-01-24). |
| DateFormat:*format* | Evaluates to the current datetime of the system in the specified format (`format`). See [Sample Date Formats](https://docs.arc.cdata.com/26.4/self-hosted/en/scripting/value-formatters/date-formatters.md#date-formats-with-literal-characters) for the available datetime formats |
| Vault:*vaultitem* | Evaluates to the value of the specified vault item. |

### Examples

Some macros, such as %Ext% and %ShortDate%, do not require an argument, but others do. All macros that take an argument use the following syntax: `%Macro:argument%`

Here are some examples of the macros that take an argument:

* %Header:headername%: Where `headername` is the name of a header on a message.
* %Header:mycustomheader% resolves to the value of the `mycustomheader` header set on the input message.
* %Header:ponum% resolves to the value of the `ponum` header set on the input message.
* %RegexFilename:pattern%: Where `pattern` is a regex pattern. For example, `%RegexFilename:^([\w][A-Za-z]+)%` matches and resolves to the first word in the filename and is case insensitive (`test_file.xml` resolves to `test`).
* %Vault:vaultitem%: Where `vaultitem` is the name of an item in the [vault](https://docs.arc.cdata.com/26.4/self-hosted/en/getting-started/administration/settings/global-settings-vault.md). For example, `%Vault:companyname%` resolves to the value of the `companyname` item stored in the vault.
* %DateFormat:format%: Where `format` is an accepted date format (see [Sample Date Formats](https://docs.arc.cdata.com/26.4/self-hosted/en/scripting/value-formatters/date-formatters.md#sample-date-formats) for details). For example, `%DateFormat:yyyy-MM-dd-HH-mm-ss-fff%` resolves to the date and timestamp on the file.

You can also create more sophisticated macros, as shown in the following examples:

* Combining multiple macros in one filename: `%DateFormat:yyyy-MM-dd-HH-mm-ss-fff%%EXT%`
* Including text outside of the macro: `MyFile_%DateFormat:yyyy-MM-dd-HH-mm-ss-fff%`
* Including text within the macro: `%DateFormat:'DateProcessed-'yyyy-MM-dd_'TimeProcessed-'HH-mm-ss%`


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