Microsoft OneDrive Create

You can use this activity to create a new driveItem or give permissions to existing items on Microsoft OneDrive.

Configuration

This tab has the following fields.

Field Description
Connection

Lists all Microsoft OneDrive connections. If no connection is found, create a Microsoft Office 365 connection.

Select Ownership Lists all ownership types that can be identified by Microsoft OneDrive. These include Me, Users, Groups, Drives, and Sites.
Select Resource Lists two resources, DriveItem and Permissions. The operations vary as per the resource selected.
Select Operation Lists all operations available for a selected resource.

The Resources and Operations table below lists all operations available for different resources and also defines each operation in detail.

Conflict Resolution Behavior Lists the conflict behavior for Create Folder operation if a folder of the same name already exists. It includes rename, fail and replace. rename is selected by default.
  • rename: Renames the current folder to FolderName 01
  • replace: Replaces the existing folder with the current folder
  • fail: Fails the create folder operation
This field is visible only if you make the following selections in the Configuration tab:

Resource:DriveItem

Operation:Create Folder

Resource Identifier Lists resource identifiers for the selected operation. It includes getByItemId and getByItemPath. This field is visible only if you make the following selections in the Configuration tab:

Resource:DriveItem

Upload Flag Lists the upload flag for the File Upload operation. It includes new and replace. new is selected by default.
  • new: Uploads a new file
  • replace: Replaces the existing file's content with the current content.
This field is visible only if you make the following selections in the Configuration tab:

Resource:DriveItem

Operation:File Upload

Resources and Operations
Resource Operation Description
DriveItem Create Folder Creates a folder on the Drive.
File Upload Uploads a file on the Drive.
Permissions Add Permissions Gives read/write permissions to users to collaborate on drive items.
Note: The File Upload operation supports the upload of files up to 4 MB only.

Input

Field Description
idOrUserPrincipalName The identifier for the user object who owns OneDrive. This field is visible in the Input tab if you make the following selections in the Configuration tab:

Ownership:Users

groupId The identifier for the group which owns the document library. This field is visible in the Input tab if you make the following selections in the Configuration tab:

Ownership:Groups

driveId The identifier for the drive requested. This field is visible in the Input tab if you make the following selections in the Configuration tab:

Ownership:Drives

siteId The identifier for the site that contains the document library. This field is visible in the Input tab if you make the following selections in the Configuration tab:

Ownership:Sites

path A path to the drive item.
Note: If you want the path to be 'root', enter "" in this field.
This field is visible in the Input tab if you make the following selections in the Configuration tab:

Resource:DriveItem

Resource Identifier:getByItemPath

parentId Id of the parent that will contain the resource being created. This field is visible in the Input tab if you make the following selections in the Configuration tab:

Resource:DriveItem

Operation:File Upload or Create Folder

Resource Identifier:getByItemId

itemId Id of the drive item. This field is visible in the Input tab if you make the following selections in the Configuration tab:

Resource:DriveItem/Permissions

Operation:File Upload /Add Permissions

Upload Flag (visible only for File Upload):replace

folderName Folder name to be created. This field is visible in the Input tab if you make the following selections in the Configuration tab:

Resource:DriveItem

Operation:Create Folder

base64EncodedString base 64 encoded string of the file content to be uploaded. This field is visible in the Input tab if you make the following selections in the Configuration tab:

Resource:DriveItem

Operation:File Upload

fileName Name of the file to be uploaded. This field is visible in the Input tab if you make the following selections in the Configuration tab:

Resource:DriveItem

Operation:File Upload

Upload Flag:new

message Message to be sent to the users to collaborate on drive items in the sharing invitation. This field is visible in the Input tab if you make the following selections in the Configuration tab:

Resource:Permissions

Operation:Add Permissions

sendInvitation Defines whether a sharing link should be sent to the recipient. If not, permission is granted directly without sending a notification. This field is visible in the Input tab if you make the following selections in the Configuration tab:

Resource:Permissions

Operation:Add Permissions

requireSignIn Decides whether a user needs to sign in or not to access the shared Drive Item. This field is visible in the Input tab if you make the following selections in the Configuration tab:

Resource:Permissions

Operation:Add Permissions

Recipients List of recipients emails/objectIds/alias to give permissions to the drive items.
Note: If none of the above (email/objectId/alias) is specified in this field, the connector runtime returns an error.
This field is visible in the Input tab if you make the following selections in the Configuration tab:

Resource:Permissions

Operation:Add Permissions

roles List of roles that are granted to recipients who have been given permissions on drive items. The permissible values for this field are read and/or write. This field is visible in the Input tab if you make the following selections in the Configuration tab:

Resource:Permissions

Operation:Add Permissions

Output

The properties that are displayed in the Output tab schema correspond to the output of this activity and can be used as input by subsequent activities in the flow. The output of an activity is displayed for informational purposes only and cannot be modified.

Resource Operation Output Reference
DriveItem All operations For a detailed output reference, see JSON representation section on the DriveItem resource type page located under Microsoft OneDrive documentation.
Permissions All operations For a detailed output reference, see Collection or array of the JSON representation for the Permission resource type located under Microsoft OneDrive documentation.