How can I delete all file references in a given folder and their associated files off of the server?
Comments
-
ATTENTION: Before deleting any data, please be aware that this is unsafe. Attempting to use the filedata in the future will cause errors. Only proceed if you are certain you will not be referencing this data in the future. If you are unsure whether you should follow these instructions, please contact support@decisions.com
This should be fairly straight forward! You just need to fetch all the items in the folder with a fetch entities step, then use an internal service step to delete the file reference and associated file for each file reference.
For the fetch entities step, set the type name to FileReferenceEntity and set the fetch criteria to entityFolderID Equals.
Then, you can set the entity Folder ID input on the step to the ID of the folder you are trying to delete items from. This will fetch all the filereferences in that folder.
From there, you can use a foreach step to loop through all the fetched file references:
Finally, from there, you can use the Delete File step found in Integration -> Internal Services -> FileReferenceService -> Delete File. This will delete the file off of the server as well as the file reference. In v9 and above, you will need to use the Call Internal Decisions Service step to use this step. You need to pass in the current item's ReferenceID (which is the ID of the file stored on the server).
Running this flow will delete all the files and file references in a given folder.
Howdy, Stranger!
Categories
- 4.1K All Categories
- 57 General
- 11 Training
- 200 Installation / Setup
- 1.1K Flows
- 106 Rules
- 259 Administration
- 212 Portal
- 487 General Q & A
- 690 Forms
- 332 Reports
- 3 Designer Extensions
- 47 Example Flows
- 51 CSS Examples
- 1 Diagram Tile
- 7 Javascript Controls
- 176 Pages
- 5 Process Mining
- New Features
- 176 Datastructures
- 68 Repository
- 214 Integrations
- 28 Multi-Tenant
- 27 SDK
- 75 Modules
- 56 Settings
- 25 Active Directory
- 12 Version 7
- 35 Version 8
- 62 Lunch And Learn Questions