activities
latest
false
UiPath logo, featuring letters U and I in white
Productivity Activities
Last updated Nov 6, 2024

Quickstart - Create, Upload, Get, and Send

The purpose of this guide is to help you create a working sample that uses different Microsoft 365 activities, including the Create Folder, Upload File, Get Item Info, and Send Mail activities.

Prerequisites

Before you begin:

  1. Complete the Microsoft 365 steps.

Steps

Build your project
  1. Add the 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 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 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 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 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., {"[email protected]"}).
    • Remember to include your email address inside {}. For more information, see the Send Mail To property details.
  5. Click 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 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).
  2. Creates a new folder in your OneDrive to store a new workbook (Create Folder).
  3. Uploads a file to the new folder (Upload File).
  4. Gets the file uploaded file metadata (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).



  • Prerequisites
  • Steps
  • How it works

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.