Skip to main content

Set Data List – Delete Files from a Specific Folder in Document Library

Use conditions to select files or folders for cleanup, and verify the matches before running the delete action.

Introduction

Yeeflow’s Set Data List action supports Execute Type: Delete when you choose a Document Library as the Data source. This feature enables automated deletion of files, folders, or both from a document library based on conditions you define.

Start with a test library and a disposable file. Check the same conditions with a read-only query before adding the Delete action to a production workflow.

Related articles:


When to Use

Use this action to clean up temporary supplier documents after the approved copies are in the records folder. Confirm the approved copies are accessible before testing the cleanup.


How to Configure Set Data List for Delete

Step 1: Set Up the Action

Add Set Data List to the workflow. Select the application and document library, then choose Delete under Execute type.

Yeeflow Set Data List with Delete selected as the execute type and a Condition button beside it.

Open Condition to select the files or folders the action can delete.


Step 2: Define Conditions

Click Condition to specify which files or folders should be deleted.

Conditions are required — without conditions, no deletion will occur.

You can add one condition or multiple conditions depending on what you want to delete:


✅ Single Condition — Delete All Files and Folders in a Folder

If you want to delete everything (both files and subfolders) inside a folder:

  • Where: Path

  • Condition: Equals

  • Value: New Supplier Folder

This condition targets matching files and folders. Check the affected folders and their contents before running it.


✅ Multiple Conditions — Delete Only Files

If you want to delete only files inside a folder:

  • Where: Path

  • Condition: Equals

  • Value: New Supplier Folder

  • And: Type

  • Condition: Equals

  • Value: file

👉 This ensures only files are deleted, subfolders remain.


✅ Multiple Conditions — Delete Only Folders

If you want to delete only subfolders inside a folder:

  • Where: Path

  • Condition: Equals

  • Value: New Supplier Folder

  • And: Type

  • Condition: Equals

  • Value: folder

This condition targets folder records. Review the files inside each matched folder before deleting the folder.


💡 You Can Add One or More Conditions

You can add one or multiple conditions to control what gets deleted.
Available fields include:
​Path, Name, Type, Size, Extension, Id, Created By, Created Time, Modified By, Modified Time.

👉 This allows you to:

  • Delete files or folders based on their type, name, size, extension, creator, or timestamps.

  • Combine conditions (e.g., delete PDF files created by a specific user, or remove files older than a certain date).

Keep your conditions specific to avoid unintended deletions.

Example condition combinations:

Goal

Example Condition Setup

Delete files with "draft" in name

Path = New Supplier Folder
​Type = file
​AND Name Contains draft

Delete only PDF files

Path = New Supplier Folder
​Type = file
​AND Extension = pdf

Delete files created by user1

Path = New Supplier Folder
​Type = file
​AND Created By = user1

Important:

  • A maximum of 500 records can be deleted in a single operation.

  • Use Query Data with the same conditions and review the results. If you intend to remove one item, add its Id condition.


Summary

The Execute Type: Delete option in Set Data List provides a powerful way to automate file and folder cleanup within document libraries. By defining precise conditions, you can control exactly what gets deleted — whether it’s all contents of a folder, only files, or only subfolders. This helps maintain a tidy and well-organized document structure without manual effort.

Use a disposable test file to verify that the intended item is removed and that other items remain. Check the workflow with zero matches and with a matching item in a different folder. Confirm what file recovery is available in your environment before enabling a cleanup workflow.

Feature

Description

Execute Type: Delete

Deletes files, folders, or both from a document library

Flexible Conditions

Define conditions to target exactly what to delete

Condition Required

Deletion will not occur without conditions

Limit

Up to 500 records can be deleted at once

Use Cases

Clean up processed files, remove empty subfolders, routine folder maintenance

Did this answer your question?