Reverse flow applied tags

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:


Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 26.0.2
Operating system and version (eg, Ubuntu 20.04): Debian 11
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.56
PHP version (eg, 7.4): 8.2
Group folders: 14.0.2
The issue you are facing:

We have a group folder with roughly 50k files and automatically applied tag.
This tag is to protect changing files from anything else than a desktop client.

My question is how to reverse, untag files in that group folder?

You can use the a File Action flow to unassign tags (see: tag_file_unassign)

Thanks Raudius,

I’ve been looking at the File Actions app in the past.
I guess this would work… However, I would need to learn scripting in Lua for which I have no time or will power.

I know it is not elegant but I will probably restore the files and run something like occ groupfolder:scan while everyone is on holiday (December 25th) :rofl:

On a more serious note, I’m surprised there’s not a single example on how to remove a tag with flow nor a question on this forum. Surely, I can’t be the only one who used a tag in vain?

The Lua script should be quite simple:

tag_name = "Completed content"
file = get_input_files()[1]

found_tags = tags_find({name= tag_name, name_exact= true})

if (#found_tags > 0) then
  tag = found_tags[1]
  tag_file_unassign(file, tag)
1 Like