AnsweredAssumed Answered

Add labels through javascript

Question asked by patrickvanhoof on Mar 2, 2018
Latest reply on Mar 13, 2018 by mehe

I have following situation: a whole lot of files and folders are now stored on a drive. We want to migrate those to Alfresco, and add the same time add the correct labels. Problem is that labels can not be assigned based on the folder structure, so a rule is no option.

What I think should be possible is the following:

  • the names of the current files need to updated anyhow, so in some way we could the needed labels at the end of the file names, separated with e.g. a $
  • the files are uploaded to Alfresco
  • a javascript has to be run that extracts the labels from the file names and add these as labels to the corresponding document
  • the javascript at the same time removes the labels from the file names


Is there a better or more efficient way to do this?

What javascript command has to be used to extract labels from the file name?