# Automated Expense Reporting

> **Applications:** Microsoft Outlook Email, Document Understanding, SAP Concur.

**Applications:** Microsoft Outlook Email, Document Understanding, SAP Concur.

**Description:** When a new email is received from a vendor for an expense that is eligible for reimbursement, the system should automatically add an expense in SAP Concur, using the relevant information extracted with Document Understanding, and upload its receipt.

****Steps:****
1. Open Studio Web and create a new project. Make sure that in the New Project window, in the **How to start the automation** drop-down, **Event based** is selected.
2. Drag a [Microsoft Outlook : Email Received](https://docs.uipath.com/activities/other/latest/productivity/office365-trigger-new-email-received) trigger activity to the canvas. In the trigger activity:
   
   1. Connect to your Microsoft Outlook 365 account.
   2. Configure the **Email folder** property to point to where you receive expense-related emails.
   
   ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/latest-docs-image-329280-075e706a-1b7a082d.webp)
   
   3. Additional filters may be added to your automation, depending on your needs.
   
   ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/latest-docs-image-329284-5770a6b2-06054a3c.webp)
3. Add a [Microsoft 365 Download Email Attachments](https://docs.uipath.com/activities/other/latest/productivity/office365-email-download-email-attachments-connections) activity to the canvas.
   1. In the **Email** property field, select the variable that is set as the output of the **Event Trigger** activity added earlied.
   2. For this example, we exclude inline attachments, so for **Exclude inline attachments** select **True**.
   
   ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/latest-docs-image-329288-9a2081ce-98f0994c.webp)

   3. Additional filters may be added to your automation, depending on your needs.
   
   ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/latest-docs-image-329308-d8c86aca-4fa269f1.webp)
4. Add a [Document Understanding: Extract Document Data](https://docs.uipath.com/activities/other/latest/document-understanding/extract-document-data) activity and:
   1. Set the **Project** field to **Predefined**.
   2. Set **Extractor** field to **Receipts**.
   3. For the **Input file** field, select the output of the **Downloaded Email Attachments&gt;Downloaded attachments list** property as as the variable.
   4. Notice that a **For Each** activity gets added above the activity that has **currentItem** as the **Input file**. This is because an email can have an array of attachments, and the For Each activity can parse through all of them.
   
   ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/latest-docs-image-329292-041b267f-e1715f86.webp)
5. Next, add a [SAP Concur: Add Quick Expense](https://docs.uipath.com/activities/other/latest/integration-service/uipath-sap-concur-create-quick-expense) activity and:
   1. Connect to your SAP Concur account.
   2. Select the appropriate **Expense type** from the drop-down menu.
   3. Configure the **Transaction currency** field to use the currency you want to use.
   4. Use a variable to set the **Amount** field to **Extract Document Data &gt; Data &gt; Total Amount &gt; Value &gt; Value**.
   5. Set the **Payment** type from the drop-down menu.
   
   ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/latest-docs-image-329296-7b62a32b-bad94839.webp)
6. Finally, add an [SAP Concur: Upload Receipt Image](https://docs.uipath.com/activities/other/latest/integration-service/uipath-sap-concur-upload-expense-receipt) activity and:
   1. Use a variable to set the **Receipt** field to **currentItem**.
   
   ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/latest-docs-image-329300-78932664-2d3f99f5.webp)
7. Execute the workflow. Your expense is added to SAP Concur alongside its corresponding receipt.
