SharePoint 2007 Document Library : Autofield certain fields based on filename and folder container

Posted on 2012-09-10
Last Modified: 2012-09-25

I have a user with that wish to automate the filling of certain fields in a document library. The document library has Year, Month, Company, Report Name columns and also contains folder with name of company.

User will upload multiple files into the document library with filename format YYYYMM_RptName into specific Company Name folders. She also wants the columns Year, Month, Company, Report Name to be filled based on the filename. So

YYYY goes into Year
MM goes into Month
RptName goes into Report Name
FolderName goes into Company

How can this be easiest done hopefully without any scripting.
Question by:NicksonKoh
    LVL 6

    Accepted Solution

    Chances are you will need to use third party tools like RecordPoints.

    Not sure if this will help you, but you can try to create the following columns:

    Year Created
    Column type - Calculated
    Data type - Single line of text type  
    Formula -

    Month Created
    Column type - Calculated
    Data type - Single line of text type  
    Formula -
    = TEXT(MONTH(Created),"mmm")

    Might be useful for you as it will autogenerated the years and month for you each time a document is uploaded.

    LVL 17

    Author Comment

    Calculated Fields looks like the way to go!
    But I want to base the formula on the Name field which is by default populated by the filename.
    LVL 17

    Author Closing Comment

    Hi ezskol,

    Calculated fields only solved half the problem it can only obtain values from other fields but not from folder.

    I also played around calculated columns or normal columns with default values on the folders. It turn out that this can auto populate the fields of new records quite well as records created on the folder will use the defaulted values of the containing folder! So that solved the other 50% of the my problem without any 3rd party tools.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
    I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now