I will have document library with field state, country and few folders like 101, 102 etc

I have file name like 102_A_B.txt When user try to upload the file it should go automatically to folder 102 and state should be filled A and country as B (based on file name).

How to do this using jquery or script. I am using o365

2 Answers 2


What you want here could be implemented by using content organizer rules...

They allow you to check fields and then move the content based on the results of the check.

Have a look here:


and here


  • there will b bulk file upload
    – Brishal
    Mar 22, 2018 at 6:39
  • Bulk is still one file after another. The Drop of DocLib will be able to handle that. Mar 22, 2018 at 6:47

After move files to specific folders via content organizer rules. Workflow can set column values automatically.

In the workflow, you can split file names via custom action, and set "State" and "Country" field using split strings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.