[SOLVED] How to apply tags to subfolders and files in them?

Nextcloud version (eg, 20.0.5): Nextcloud 24.0.6
Operating system and version (eg, Ubuntu 20.04): Debian 11
Apache or nginx version (eg, Apache 2.4.25): Apache
PHP version (eg, 7.4): 7.4.30

I have number of folders with subfolders (and deeper trees too) right at the end of those there are some files.

I’ve applied a TAG to the top folder hopeing this will filter down to bottom of the directories, but it doesn’t.

How can I apply tags to top folders and get the directory tree apply same tag?

Using workflow engine (flow).
IF Filesystem tag is: Path to highest level folder for that tag and then set tag on that folder.
THEN tag with: Tag.
All files and folders underneath this will inherit that tag.

However you cannot use the workflow engine to automatically apply after files are created and edited. You has to either manually “touch” each file, move them or add the desired tags. Only with any new file after creating your workflow rule, will automatically apply tags according to workflow engine rules. This works even with multiple rules.

Thanks Kerasit,

I had deleted all subfolders with files and pasted them back in, which did work and tags were applied.

I must try and see if ‘move’ folder will work within Nextcloud, that would save me transfering tons of files.

Cheers!
dzidek23

Hi Kerasit,

just came to here to say that running occ file:scan --all does trigger system tags to be checked and reapplied.

Had to scan files for some unrelated issues and all of a sudden some folders were tagged.

So I guess you can apply tags to files and folders already in place.

1 Like

Thank you. This is very valuable info! It is a good trick to know. However for bigger installations with alot of files, you will refrain from doing a rescan unless you really has to, as it will run for quite some time. However I am gratefull for the info!