# Flow Classic

## General

This document will provide guidance on installing and configuring the Travel and Expense App. The Travel and Expense App contains six separate workflows.

## Workflows

| App                      | Required Connectors/Services                                                    |
| ------------------------ | ------------------------------------------------------------------------------- |
| Create Expense           | IFS OData, File System, Azure AI Document Intelligence\*                        |
| Review Expenses          | IFS OData, File System                                                          |
| Confirm Expenses         | IFS OData, HTML to PDF                                                          |
| Approve Expenses         | IFS OData, Email                                                                |
| Emailed Receipts Service | Email, Azure Storage Account, Microsoft Graph, Azure AI Document Intelligence\* |
| Emailed Receipts         | IFS OData, File System, Azure Storage Account                                   |

{% hint style="info" %}
\* Azure AI Document Intelligence(former Azure Form Recognizer) is only needed for automatically scanning receipts. If that functionality is not needed it can manually be removed from the workflow.
{% endhint %}

## System and Version

| System               | Version                                                                    |
| -------------------- | -------------------------------------------------------------------------- |
| IFS Applications     | IFS Cloud 23R1                                                             |
| Novacura Flow Server | 6.15.3                                                                     |
| Novacura Flow Studio | 6.15.5                                                                     |
| Connectors           | OData v2.1.23, File System, REST Service, Send E-Mail, Convert HTML To PDF |

## Microsoft Azure Services

### Azure Storage Account

If you plan to utilize the Email Receipts and Email Receipts Service, set up a storage account for Blob and Table storage, [Set Up Azure Storage Account](https://docs.novacura.com/extensibility-and-integration/products/storage/azure-storage-account/how-to-guides/set-up-azure-storage-account).

### Azure AI Document Intelligence

If you plan to utilize the Create Expense - Scan Receipt functionality or Email Receipts and Email Receipts Service, set up a Form Recognizer Cognitive Service, [Set Up Form Recognizer](https://docs.novacura.com/extensibility-and-integration/products/cognitive-services/form-recognizer/how-to-guides/set-up-form-recognizer). More information on Form Recognizer pricing can be found [here](https://azure.microsoft.com/en-us/pricing/details/form-recognizer/).&#x20;

### Microsoft Graph

If you plan to utilize the Email Receipts and Email Receipts Service, create an App Registration for reading emails and attachments in a unified inbox. The App Registration needs Mail.ReadWrite permissions to be able access the mailbox. Read more in the how-to guides [Create App Registration](https://docs.novacura.com/extensibility-and-integration/products/active-directory/microsoft-graph/how-to-guides/create-app-registration) and [Limit Permissions to a Specific Mailbox](https://docs.novacura.com/extensibility-and-integration/products/active-directory/microsoft-graph/how-to-guides/limit-permissions-to-a-specific-mailbox).

## Flow Connectors

### IFS OData Connector

If you do not have a connector set up, you can see an example [here](https://docs.novacura.com/extensibility-and-integration/products/studio/connectors/odata-connector).

{% hint style="warning" %}
If you already have an IFS Cloud OData connector setup, you can skip this step and use the existing connector instead.
{% endhint %}

{% hint style="info" %}
For how to add a new projection to the connector click [here](https://docs.novacura.com/extensibility-and-integration/products/erp/ifs-cloud/how-to-guides/add-new-projection-to-the-connector).
{% endhint %}

Used Projections in Workflows

<details>

<summary>Get User Defaults Cloud - Fragment</summary>

* CompanyHandling
* SitesPerUserHandling
* UserHandling

</details>

<details>

<summary>Approve Expenses Cloud</summary>

* CreditCardTransactionsHandling
* EmployeesHandling
* ExpenseSheetHandling
* PersonHandling

</details>

<details>

<summary>Confirm Expenses Cloud</summary>

* CreditCardTransactionsHandling
* CurrencyRatesHandling
* DocReferenceObjectAttachmentHandling
* ExpenseSheetHandling
* MediaItemsHandling
* MediaItemHandling
* TravelExpensesEmployeeHandling

</details>

<details>

<summary>Create Expense Cloud</summary>

* CompanyHandling
* CreditCardConfirgurationHandling
* CreditCardTransactionHandling
* CurrencyRatesHandling
* ExpenseRuleHandling
* TravelExpensesEmployeeHandling

</details>

<details>

<summary>Emailed Receipts Cloud</summary>

* CompanyHandling
* CurrencyRatesHandling&#x20;
* EmployeesHandling
* ExpenseRuleHandling
* ExpenseSheetHandling
* TravelExpensesEmployeeHandling

</details>

<details>

<summary>Project Activity Cloud - Fragment</summary>

* TravelExpensesEmployeeHandling

</details>

<details>

<summary>Remove Media Connections Or  Delete Media File Cloud - Fragment</summary>

* MediaItemHandling
* MediaLibraryManagerHandling

</details>

<details>

<summary>Review Expenses Cloud</summary>

* CreditCardTransactionsHandling
* ExpenseSheetHandling
* ProjectScopeAndScheduleHandling
* TravelExpensesEmployeeHandling
* WorkTaskHandling

</details>

<details>

<summary>Work Order LOV Cloud - Fragment</summary>

* MaintenanceMaterialRequisitionHandling

</details>

### File System Connector

If you don't have a connector set up, you can see an example [here](https://docs.novacura.com/extensibility-and-integration/products/studio/connectors/file-system/how-to-guides/file-system-example).

### HTML to PDF Connector

If you don't have a connector set up, you can see an example [here](https://docs.novacura.com/extensibility-and-integration/products/studio/connectors/html-to-pdf/how-to-guides/html-to-pdf-example).

### Email Connector

If you don't have a connector set up, you can see an example [here](https://docs.novacura.com/extensibility-and-integration/products/studio/connectors/email/how-to-guides/email-example).

### REST Connectors

#### REST - Azure AI Document Intelligence

A REST Connector Project must be set up to utilize the Microsoft Form Recognizer Cognitive Service.

Create a new REST Connector named "Microsoft Form Recognizer v3.0" and import the configuration file "Microsoft Form Recognizer v3.0.ncrcp", for more information see [Import a REST Configuration](https://docs.novacura.com/extensibility-and-integration/products/studio/connectors/rest-connector/how-to-guides/import-a-rest-configuration).

* After the connector has been imported, navigate to the connector Authentication and select “…” to the right of API Keys
* Replace the apiKeyHeader and the apiKeyQuery with KEY 1 from your [Microsoft Form Recognizer Cognitive Service](https://docs.novacura.com/extensibility-and-integration/products/cognitive-services/form-recognizer/how-to-guides/set-up-form-recognizer)

<div align="left"><img src="/files/-MjmcizdJEh-TIOrgkj0" alt=""></div>

* Select “Save” to save the API Keys
* Select “Save” to save the REST Connector Configuration

<div align="left"><img src="/files/-MjmebOiQq_pD9ZG1E0c" alt=""></div>

####

#### REST - Azure Blob Storage

A REST Connector Project must be set up to utilize the Microsoft Azure Blob Storage Service. The blob storage is used for temporary storing emailed files until the user has handled the receipt i.e., turned into an expense.

Create a new REST Connector named "Azure Blob Storage" and import the configuration file "Azure Blob Storage.ncrcp", for more information see [Import a REST Configuration](https://docs.novacura.com/extensibility-and-integration/products/studio/connectors/rest-connector/how-to-guides/import-a-rest-configuration).

* After the connector has been imported, navigate to the connector Authentication and select “…” to the right of API Keys
* Enter the information from your shared access key for your [storage account](https://novacura.gitbook.io/technical-documentation/products/storage/azure-storage-account/how-to-guides/set-up-azure-storage-account#flow-rest-connector-information)

<div align="left"><img src="/files/-MkGoUVi0PjZkwxQAO5u" alt=""></div>

* Select “Save” to save the API Keys
* Select “Save” to save the REST Connector Configuration

<div align="left"><img src="/files/-MkGogkc_OF3iVlMrGxZ" alt=""></div>

* Connector setup completed

#### REST Azure Table Storage

A REST Connector Project must be set up to utilize the Microsoft Azure Table Storage Service. The table storage is used for temporary storing information about emailed receipts.

Create a new REST Connector named "Azure Table Storage" and import the configuration file "Azure Table Storage.ncrcp", for more information see [Import a REST Configuration](https://docs.novacura.com/extensibility-and-integration/products/studio/connectors/rest-connector/how-to-guides/import-a-rest-configuration)

* After the connector has been imported, navigate to the connector Authentication and select “…” to the right of API Keys
* Enter the information from your shared access key in your [storage account](https://docs.novacura.com/extensibility-and-integration/products/storage/azure-storage-account/how-to-guides/set-up-azure-storage-account#flow-rest-connector-information)

<div align="left"><img src="/files/-MkGskJPaTC0qweTP9DQ" alt=""></div>

* Select “Save” to save the API Keys
* Select “Save” to save the REST Connector Configuration

<div align="left"><img src="/files/-MkGsr9ZRqXs1B2CMtXI" alt=""></div>

* Connector setup completed

#### REST - Microsoft Graph

A REST Connector Project must be set up to utilize the Microsoft Graph API. The connector will be used to read messages and fetch attachments in the unified inbox for receipts.

Create a new REST Connector named "Microsoft Graph Expenses" and import the configuration file "Microsoft Graph Expense.ncrcp", for more information see [Import a REST Configuration](https://docs.novacura.com/extensibility-and-integration/products/studio/connectors/rest-connector/how-to-guides/import-a-rest-configuration)

* After the connector has been imported, navigate to the connector Global parameters and select “…” to the right of Edit parameters.&#x20;
* Enter your Client ID and Client Secret from your [application registration](https://docs.novacura.com/extensibility-and-integration/products/active-directory/microsoft-graph/how-to-guides/create-app-registrationhttps://docs.novacura.com/extensibility-and-integration/products/active-directory/microsoft-graph/how-to-guides/create-app-registration).&#x20;
* Enter the directory tenant that you want to request permission from. This can be in GUID or friendly name format.

<div align="left"><img src="/files/-MlJfRQdKRF5v_AFAo8Z" alt=""></div>

* Select “Save” to save the Global parameters
* Select “Save” to save the REST Connector Configuration
* Connector setup completed

## Flow Properties

Before installing the workflows, it is required to create several **Global** Flow Properties within Novacura Flow Studio.

#### Flow Text Properties

<table data-header-hidden><thead><tr><th width="263.0103211376151">Flow Property</th><th width="172.92881908839615">Example Value</th><th>Description</th></tr></thead><tbody><tr><td>Flow Property</td><td>Example Value</td><td>Description</td></tr><tr><td>AppOwner</td><td>ifsapp</td><td>IFS environment application owner (Schema).</td></tr><tr><td>EnvironmentUrl</td><td>server.dev.novacuracloud.net</td><td>Base address for the temporary image of the receipt to be viewed by the Image Viewer User Step element.</td></tr><tr><td>LocalImagePath</td><td>D:\home\site\wwwroot\images</td><td>Local server folder for image of the receipt to be viewed by the Image Viewer User Step element. Should be somewhere under the www root.</td></tr><tr><td>ExpenseDocClass</td><td>EXPENSE</td><td>Document class for the expense report that will be added to the expense sheet header when the expense sheet is confirmed.</td></tr><tr><td>ExpenseAdmin</td><td>admin@example.com</td><td>If something goes wrong in the background workflow for receiving emailed receipts, the error message will be sent by email to this address. Multiple email addresses can be added as comma separated values.</td></tr><tr><td>ExpenseBlobContainerName</td><td>expense-files</td><td>Name of the container to be used in the blob storage for temporarily  storing emailed receipt files.</td></tr><tr><td>ExpenseInboxAddress</td><td>expense.receipts@example.com</td><td>The email address for the unified inbox receipts.</td></tr><tr><td>ExpenseInlineAttachments</td><td>True</td><td>Include inline attachments in messages or not for emailed receipts.</td></tr><tr><td>ExpenseTableName</td><td>Receipts</td><td>Name of the table to be used in the Table Storage Service.</td></tr><tr><td>ExpenseTablePartitionKey</td><td>novacura-labs</td><td>Name of the partition key to be used in the Table Storage Service. Every record in a table needs to have a partition key set.</td></tr></tbody></table>

#### Flow Table Properties

| Flow Property  | Columns | Example Value            | Description                                                                                                                                                        |
| -------------- | ------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ExpenseDomains | Domain  | novacura.com novacura.se | Valid domain names for the emailed receipts. Only senders from the specified domains will be handled by the workflow. Messages from other domains will be deleted. |

## Installation

{% hint style="warning" %}
Make sure that you have created all connectors and Flow properties before importing the workflows.
{% endhint %}

### 1. Import Workflows

Import workflows in the file "Expense Reporting.wap".

{% hint style="warning" %}
There are some workflows that have multiple IFS connectors, these should be mapped to the same IFS connector when the import is done. The different connectors are only used for demo purposes.
{% endhint %}

For detilas see [Import Workflows](https://docs.novacura.com/extensibility-and-integration/products/studio/applications/workflow/how-to-guides/import-workflows)

### 2. Setting Menu Roles

Together with the imported workflows there will also be a menu. Connect the menu to your roles to make them available for users.

For details see [Setting Menu Roles](https://docs.novacura.com/extensibility-and-integration/products/studio/applications/workflow/how-to-guides/setting-menu-roles)

### 3. Publishing Workflows

Within the Server Contents Window right click on the Expense Reporting folder and select “Publish”. This process can take a few minutes but once complete, a Publish Successful message will be displayed.

If you receive any errors during the publication of the workflow. Please review the error detail and consult your support contact with the relevant information.

The workflows will now be available to execute on your chosen Flow client. For instructions on individual Travel and Expense functions, please consult the function individual documentation provided separately.

For details see [Publishing Workflows](https://docs.novacura.com/extensibility-and-integration/products/studio/applications/workflow/how-to-guides/publishing-workflows)


---

# 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.novacura.com/marketplace-documentation/applications/explore-apps/ifs/travel-and-expense/installation/ifs-cloud/flow-classic.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.
