Skip to content

Delete Document

Properties

  • Input
  • Document Id
    • Type:int
    • Description: The unique identifier of the document to be deleted. This is a required argument.
  • Delete Recursively
    • Type:bool?
    • Description: Specifies whether to delete all linked documents recursively. This is a required argument.
  • Delete Training Documents
    • Type:bool?
    • Description: Specifies whether to also delete training documents when deleting documents recursively. This is a required argument.

Usage

  1. Setup Activity:
  2. Add the "Delete Document" activity to your UiPath workflow.
  3. Configure the required input arguments:
    • Document Id: Provide the ID of the document you wish to delete.
    • Delete Recursively: Set this totrueif you want to delete all linked documents recursively.
    • Delete Training Documents: Set this totrueif you also wish to delete any associated training documents when deleting recursively.
  4. Execution:
  5. The activity executes asynchronously, deleting the specified document.
  6. IfDelete Recursivelyis set totrue, all documents linked to the specified document will also be deleted.
  7. IfDelete Training Documentsis set totrueandDelete Recursivelyis enabled, associated training documents will be included in the deletion process.
  8. Output:
  9. The activity returns aDocumentViewModelrepresenting the deleted document. This can be used to confirm the deletion or log the document details.

Considerations

  • Data Integrity: Ensure that the document ID is valid and accessible to avoid errors during deletion.
  • Cascading Deletions: Be cautious when setting theDelete RecursivelyandDelete Training Documentsflags, as these will result in multiple documents being deleted, which may impact related workflows or data integrity.
  • Irreversible Action: Deleting documents is usually irreversible, so ensure that backups or confirmations are in place if needed.