Way to tell if a document was added to specific folder | Community
Skip to main content
FrankatMSC
Level 4
May 29, 2025
Solved

Way to tell if a document was added to specific folder

  • May 29, 2025
  • 2 replies
  • 670 views

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.
Best answer by Sven-iX

@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

 

2 replies

CrisDonaldson
Level 3
June 2, 2025

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

FrankatMSC
Level 4
June 6, 2025

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.     

Sven-iX
Community Advisor
Sven-iXCommunity AdvisorAccepted solution
Community Advisor
June 5, 2025

@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