none
How to Filter Documents in Doc Library Based on User Logon Name

    Question

  • I have a requirement to upload mass docs of multiple users(in 100's) in a doc library and filter this library to show the logged in user only docs related to him/her. I tried to name the docs with username and use ME filter; Name contains/begins with [Me] , but this throws "Render Failed" error. Is there any different approach to do it without C# or .Net coding?
    Friday, August 30, 2013 7:15 PM

Answers

All replies

  • This might be related to the pagination on the view.  How many items do you have the view trying to return?

    Saturday, August 31, 2013 10:14 AM
    Answerer
  • Hello,

    As per my understanding, you are uploading multiple doc's and rename doc with user name and applying [Me ] filter. If this is the case then [Me] will not work.

    Since [Me] can only be worked with person or group column so you have to add user name in that column only. In your case, there might be two workaround:

    Either you upload docs for single user at a time and manually add that user in custom person or group column via datasheet view OR upload all docs and add user name for respective doc via datasheet view.

    Let us know in case any doubt


    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, September 02, 2013 6:11 AM
    Moderator
  • There are 900 docs to upload, so i don't think manually updating Username is feasible. I'm trying to achieve this through 2 workflows.  

    1. First workflow on Item create, updates Title field with File name. 
    2. Step 2.:Created Calculated Column that trims Title field and retries Username only.
    3. Step 3: Created Person or Group column.
    4. Step 4: second workflow on edit item;  Updates Person Group Column with Username retrieved in step 2.
    5. Step 5: Filter doc library using [Me].

    Issue is, this is working fine if i upload 2-3 docs, but when i upload more docs like 9-10 , the second workflow throws error only for few docs. Error occurs when i'm trying to update People Group column. When i upload 9 docs, it shows error for only 3. 

    Wednesday, September 04, 2013 9:35 PM
  • Hello,

    Instead of workflow could you consider powsershell? See my reply in below thread:

    http://social.msdn.microsoft.com/Forums/en-US/c688fff9-3d4b-4ded-bf3e-6ae36bd236d1/change-the-owner-of-a-list-item

    Using above script you can update person or group field for all documents without any WF.


    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, September 05, 2013 10:37 AM
    Moderator
  • This is Share Point 2007. I don't think i can use power shell. I dropped second workflow and updating the username manually. Now the issue is with the Username. It is not consistent. For Almost all users its 10 characters so In Step 2(listed in my above post), i'm using Trim function to get last 10. This is not working for users with 9 or 11 characters. Any good solution to resolve this and get username ir-respective of 9 or 10 or 11 characters?
    Wednesday, September 11, 2013 4:24 PM
  • What is the value of Title field? and what you are getting in calculate column?

    You can also share calculate column formula.


    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, September 12, 2013 4:46 AM
    Moderator
  • The Value in "Title" field is name of the doc for ex: ABC-smijoh0812. last 10 characters is username. Formula in Calculate column is =RIGHT(Title,LEN(Title)-4). this gives me last 10 characters of title. Hope this makes sense. How can i share Calculated column?
    Monday, September 16, 2013 2:56 PM
  • Hello,

    Here is the formula to get substring after "-". I have tested this and works well:

    =RIGHT(Title,LEN(Title)-INT(FIND("-",Title)))

    http://sharepoint.stackexchange.com/questions/29140/using-calculated-field-to-retrieve-substring-of-another-field

    Hope it could help


    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by fadnan Thursday, September 19, 2013 5:23 PM
    Tuesday, September 17, 2013 5:28 AM
    Moderator