# Quickstart - Create, Upload, Get, and Send

> Step-by-step guide to building a sample that creates a folder, uploads a file, retrieves attachments, and sends email using Microsoft 365 activities.

The purpose of this guide is to help you create a working sample that uses different Microsoft 365 activities, including the [Create Folder](https://docs.uipath.com/activities/other/latest/productivity/office365-create-folder), [Upload File](https://docs.uipath.com/activities/other/latest/productivity/office365-upload-file), [Get Item Info](https://docs.uipath.com/activities/other/latest/productivity/office365-get-item-info), and [Send Mail](https://docs.uipath.com/activities/other/latest/productivity/office365-send-mail) activities.

## Prerequisites

Before you begin:

1. Complete the Microsoft 365 steps.

## Steps

### Build your project
1. Add the [Microsoft Office 365 Scope](https://docs.uipath.com/activities/other/latest/productivity/microsoft-office-365-scope) activity to your project.
2. Enter the **ApplicationId** for your registered application (for more information, see the guide).
3. From the **AuthenticationType** drop-down list, select the applicable type (e.g., *InteractiveToken*).
   * If you select *InteractiveToken* and run the sequence while you're present, you don't need to add a **Password**, **Tenant**, or **Username** in the **Unattended** section (leave empty).
4. From the **Services** drop-down list, select *Files* (you can select the other services as well).
5. Add the [Create Folder](https://docs.uipath.com/activities/other/latest/productivity/office365-create-folder) activity after the **Microsoft Office 365 Scope** activity.
6. Enter a **Name** for the folder (e..g, *"Quickstarts*").
7. In the **ParentDirectory** property, enter the directory where this folder will be created.
   * If you want to create the folder in your root directory (like we do in this example), leave this property empty.
8. Create and enter a new `DriveItem` variable for your **Folder** value (e.g., *newFolder*).
   * When creating your variable, select *Microsoft.Graph.DriveItem* as the variable type.
9. Add the [Upload File](https://docs.uipath.com/activities/other/latest/productivity/office365-upload-file) activity after the **Create Folder** activity.
10. In the **Destination** property, enter the `DriveItem` variable you created for the **Create Folder** activity (e.g., *newFolder*).
11. Enter the **LocalFilePath** of the file that you want to upload (e.g., *"C:\UiPath_Projects\DemoFile.docx"*)
12. Create and enter a new `DriveItem` variable for your **Result** value (e.g., *uploadedFile*).

    * When creating your variable, select *Microsoft.Graph.DriveItem* as the variable type.
13. Add the [Get Item Info](https://docs.uipath.com/activities/other/latest/productivity/office365-get-item-info) activity after the **Upload File** activity.
14. In the **ItemID** property, enter the `DriveItem` variable that you created for the **Upload File** activity (e.g., *uploadedFile*) and append *.Id* at the end of the variable (e.g., *uploadedFile.Id*)
15. Create and enter a new `DriveItem` variable for your **Item** value (e.g., *getFile*).

    * When creating your variable, select *Microsoft.Graph.DriveItem* as the variable type.

### Test your project
1. To verify that your file was uploaded and found in your new OneDrive folder, add the [Send Mail](https://docs.uipath.com/activities/other/latest/productivity/office365-send-mail) activity after the **Get Item Info** activity.
2. In the **Body** property, enter the following `String` to include a link to the file: *"Here is a link to the file: "+getFile.WebUrl*.
3. Enter a **Subject** for your email (e.g., *"Link to OneDrive File"*).
4. Enter your email address in the **To** property (e.g., *{"user@uipath.com"}*).
   * Remember to include your email address inside {}. For more information, see the **Send Mail** [To](https://docs.uipath.com/activities/other/latest/productivity/office365-send-mail) property details.
5. Select start and verify your results by checking your email and clicking the link to view your file.

When you're ready, try the other [Quickstart](https://docs.uipath.com/activities/other/latest/productivity/office365-quickstarts) guides to get more familiar with the different Microsoft Office 365 activities.

## How it works

After completing the steps in this guide, you'll have an automation sequence that does the following:

1. Establishes a connection to your registered Microsoft 365 application ([Microsoft Office 365 Scope](https://docs.uipath.com/activities/other/latest/productivity/microsoft-office-365-scope)).
2. Creates a new folder in your OneDrive to store a new workbook ([Create Folder](https://docs.uipath.com/activities/other/latest/productivity/office365-create-folder)).
3. Uploads a file to the new folder ([Upload File](https://docs.uipath.com/activities/other/latest/productivity/office365-upload-file)).
4. Gets the file uploaded file metadata ([Get Item Info](https://docs.uipath.com/activities/other/latest/productivity/office365-get-item-info)).
5. Verifies the results of the **Upload File** and **Get Item Info** activities by sending you an email that includes a link to your uploaded file ([Send Mail](https://docs.uipath.com/activities/other/latest/productivity/office365-send-mail)).

![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/activities-docs-image-180932-746ab5c0.webp)
