Skip to main content

Delete File

AutomatR.OneDriveApp.Activities.DeleteFile

The "Delete File" activity in AutomatR is part of the OneDrive activities package, providing automation capabilities to delete files from Microsoft OneDrive. This activity streamlines file management tasks in OneDrive, allowing users to remove unwanted or obsolete files as part of their automation workflows.

Properties

NameDescription
Input
PathSpecifies the path of the file to be deleted within OneDrive. It represents the location of the file within the user's OneDrive account. String variables containing the file path.
Misc
Display NameProvides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variables containing the desired display name.
Optional
DelaySpecifies the amount of time (in seconds) to wait before executing the "Delete File" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e. 1.
Output
ResultOutputs the result of the "Delete File" operation, indicating whether the file deletion was successful or any encountered errors. Variables of relevant types (e.g., Boolean variables) to store the operation result.

How to use:

  1. Drag and drop the "Delete File" activity onto the workflow.
  2. Configure the properties by specifying the path of the file to be deleted within OneDrive.
  3. Optionally, configure the delay and customize the display name.
  4. Execute the workflow to delete the specified file within OneDrive.

Example: Consider an example where the "Delete File" activity is used to delete a file named "obsolete_report.xlsx" from the "Reports" directory in OneDrive:

Delete File:
Display Name: "Delete Obsolete Report"
Path: "/Documents/Reports/obsolete_report.xlsx"
Result: isDeleteSuccessful

In this example, the activity deletes the file "obsolete_report.xlsx" from the specified path within the "Reports" directory in OneDrive. The result of the operation (success or failure) is stored in the Boolean variable "isDeleteSuccessful" for further handling in the workflow.