# Quickstart - Create, Write, and Read

> 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), [Create Workbook](https://docs.uipath.com/activities/other/latest/productivity/office365-create-workbook), [Rename Sheet](https://docs.uipath.com/activities/other/latest/productivity/office365-rename-sheet), [Write Range](https://docs.uipath.com/activities/other/latest/productivity/office365-write-range), and [Read Range](https://docs.uipath.com/activities/other/latest/productivity/office365-read-range) 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), [Create Workbook](https://docs.uipath.com/activities/other/latest/productivity/office365-create-workbook), [Rename Sheet](https://docs.uipath.com/activities/other/latest/productivity/office365-rename-sheet), [Write Range](https://docs.uipath.com/activities/other/latest/productivity/office365-write-range), and [Read Range](https://docs.uipath.com/activities/other/latest/productivity/office365-read-range) 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 `DriveItem` variable for your **Folder** value (e.g., *newFolder*).
   * When creating your variable, select *Microsoft.Graph.DriveItem* as the variable type.
9. Add the [Create Workbook](https://docs.uipath.com/activities/other/latest/productivity/office365-create-workbook) activity after the **Create Folder** activity.
10. Create and enter a `String` variable for your **Name** value (e.g., *workbookName*).
11. In the **Parent** property, enter the `DriveItem` variable you created for the **Create Folder** activity (e.g. *newFolder*)
12. Create and enter a `DriveItem` variable for your **Workbook** value (e.g., *newWorkbook*).
13. Add the [Rename Sheet](https://docs.uipath.com/activities/other/latest/productivity/office365-rename-sheet) activity after the **Create Workbook** activity.
14. Enter a **NewSheetName** (e.g., *"DisneyCharacters"*).
15. Enter the **Original Sheet Name** (e.g., *"Sheet1"*).
16. In the **Workbook** property, enter the `DriveItem` variable you created for the **Create Workbook** activity (e.g. *newWorkbook*).
17. Add the [Build Data Table](https://docs.uipath.com/activities/other/latest/user-guide/build-data-table) activity after the **Rename Sheet** activity.
18. Select the **DataTable** button in the activity to open the **Build Data Table** wizard.
19. Enter at least two columns and two rows of data (for an example, see the image below).
20. Create and enter a `DataTable` variable for your **DataTable** value (e.g., *disneyCharacters*)
21. Add the [Write Range](https://docs.uipath.com/activities/other/latest/productivity/office365-write-range) activity after the **Build Data Table** activity.
22. Enter the `DataTable` variable you created for the **Build Data Table** activity (e.g., *disneyCharacters*).
23. Enter the **SheetName** you entered for the **Rename Sheet** activity (e.g., *"DisneyCharacters"*).
24. Enter the **StartingCell** (e.g., *"A1"*).
25. In the **Workbook** property, enter the `DriveItem` variable you created for the **Create Workbook** activity (e.g. *newWorkbook*).
26. To indicate when the robot finishes the first set of activities, add Write Line activity after the **Rename Sheet** activity.
27. Enter a `String` message (e.g., *"Finished creating: "+folderName+" folder, "+workbookName+" workbook, and "+sheetName+" worksheet!"*).

#### **Test your project**

1. To verify that your `DataTable` was written to your worksheet, add the [Read Range](https://docs.uipath.com/activities/other/latest/productivity/office365-read-range) activity after the [Write Line](https://docs.uipath.com/activities/other/latest/user-guide/write-line) activity.
2. Enter a valid **Range** (e.g., *"A2:B6"*).
3. In the **SheetName** property, enter the name from the **Rename Sheet** activity (e.g., *"Disney Characters"*).
4. In the **Workbook** property, enter the `DriveItem` variable you created for the **Create Workbook** activity (e.g. *newWorkbook*).
5. Select **Add Headers** (this can be useful if you plan to output the data table to a new).
6. Create and enter a `DataTable` variable for your **DataTable** value (e.g., *verifiedDisneyCharacters*)
7. To see the output values, add the [Output Data Table](https://docs.uipath.com/activities/other/latest/user-guide/output-data-table) activity after the **Read Range** activity.
8. In the **DataTable** property, enter the `DataTable` variable you created for the **Read Range** activity (e.g., *verifiedDisneyCharacters*).
9. Create and enter a `String` variable for the **Text** property (e.g., *datatableOutput*).
10. Add another [Write Line](https://docs.uipath.com/activities/other/latest/user-guide/write-line) activity after the **Output Data Table** activity.
11. Enter the `String` variable you created for the **Output Data Table** activity as your **Text** property value (e.g., *datatableOutput*).
12. Select run and verify the results in the output window.

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. Creates a new workbook in the new folder ([Create Workbook](https://docs.uipath.com/activities/other/latest/productivity/office365-create-workbook)).
4. Renames the default "Sheet1" in the new workbook ([Rename Sheet](https://docs.uipath.com/activities/other/latest/productivity/office365-rename-sheet)).
5. Builds a new `DataTable` object to write to the worksheet ([Build Data Table](https://docs.uipath.com/activities/other/latest/user-guide/build-data-table)).
6. Writes the created `DataTable` to the worksheet ([Write Range](https://docs.uipath.com/activities/other/latest/productivity/office365-write-range)).
7. Verifies the **Write Range** activity by reading back the values ([Read Range](https://docs.uipath.com/activities/other/latest/productivity/office365-read-range) and [Output Data Table](https://docs.uipath.com/activities/other/latest/user-guide/output-data-table)).

![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/activities-docs-image-179684-8537ea18.webp)
