I am developing a Staff Appraisal site for the school I teach in. The idea is for each staff member to have a document library with their appraisal documents securely contained by permissions. We have 100+ teaching staff, so lots of libraries!

Is there a way to automatically redirect a teacher to their library when they log in based on their login credentials? I could do this via clicking through a staff directory but the Principal is keen for a personalized experience so when a user logs in they get a welcome message like "Good Morning Dave," and their library opens without having to click anywhere else.

My guess would be to set up a page with code snippets that do the redirecting - does this sound right? I don't know how to code at all, but the IT guys at school should be able to help me out if I can show them the idea.


1 Answer 1


Auto redirecting to a document library is not a bad idea. With code you can do anything.

You have to keep below things in mind to make it fully functional

  1. You should name document libraries predictable. i.e. Dave-Appraisal-Lib. If you have more people with same name, then think of a logic to add numbers with name. This will help you in constructing URLs.
  2. You can add a Content Editor Webpart on home page
  3. Write JSOM code functions, and call it from $(document).ready. Function can contain code of getting the logged in user name such as _spPageContextInfo.userDisplayName this will help you in predicting library name
  4. Construct your URL to Document Library, and then redirect.
  • 1
    Assuming all names are uniqe maybe name the libraries with their names and then code a simple javascript redirect that would use either what Asad here suggested or use SPServices' get current user
    – Kloggy
    Nov 21, 2017 at 22:13

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.