Skip to main content
FrankatMSC
Level 4
May 29, 2025 7:53 PM UTC
Solved

Way to tell if a document was added to specific folder

I have a few scenarios where I use watch events to listen for new documents.  However now I want to create one to listen for a document added to a specific folder in projects.
Is there any specific way to do this in the watch event directly or would I have to listen for all added documents and then somehow test for whether it lives in that folder?
I don't see anyway to identify the folder a document lives in.

 

Thanks in advance for your help

Frank 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Sven-iX
Sven-iXAccepted solution
Community Advisor
Jun 5, 2025 9:04 AM UTC

@frankatmsc 

@crisdonaldson is correct: There is no event "document added to folder"; folders are just a collection of tags associated with the document. 

 

The problem is you won't get the folders in the event bundle so you'd have to have some means of tracking that collection. 

 

You could

  • create a field "folderIDs" in a hidden (admin-only) section
  • listen for document creation or updates 
  • look up the document record and get its folders collection - or the attribute folderIDs, as well as the "DE:folderIDs" field
  • compare the value of DE:folderIDs with the current collection and identify the new folder (ie delta between these IDs)
  • If it's a folder you're tracking - take action

 

3 replies

CrisDonaldson
Level 3
Jun 2, 2025 2:15 PM UTC

You would have to watch for all documents and then filter based on the folder name or folder ID.

Translate
FrankatMSC
Level 4
Jun 6, 2025 10:38 AM UTC

Thank you both for your suggestions.  I'm looking into ways of tracking the folder ID's.  If I get a solid way to solve this I'll post it.     

Translate
Sven-iX
Community Advisor
Sven-iXCommunity AdvisorAccepted solution
Community Advisor
Jun 5, 2025 9:04 AM UTC

@frankatmsc 

@crisdonaldson is correct: There is no event "document added to folder"; folders are just a collection of tags associated with the document. 

 

The problem is you won't get the folders in the event bundle so you'd have to have some means of tracking that collection. 

 

You could

  • create a field "folderIDs" in a hidden (admin-only) section
  • listen for document creation or updates 
  • look up the document record and get its folders collection - or the attribute folderIDs, as well as the "DE:folderIDs" field
  • compare the value of DE:folderIDs with the current collection and identify the new folder (ie delta between these IDs)
  • If it's a folder you're tracking - take action

 

Translate