locked
Document Library Filters RRS feed

  • Question

  • Hi, 

    I have a document library where i published InfoPath documents, I need to create a view filtered on the following criteria:
    If the Title of the document contains the Name of the Logged in User show the document otherwise hide it. 

    I'm using the filter option: Title - Contains - [Me], and it is generating an error. What should i do to set the proper filter? 

    Thanks 
    Wednesday, October 28, 2009 11:51 AM

Answers

  • Hi,

    There has two ways to filter the list:

    1.     You can create a new “single line of text” column named “login” in the custom list, and set the column default value as calculated value “=Me”, then filter the list in SPD

    a)     Open your list AllItem.aspx page, and "Convert to XSLT Data View".

    b)     On the “Common Data View Tasks pane” on your data view web part, click “Filter”

    c)     Check the “Add XSLT Filtering” checkbox, then click “Edit…” button

    d)     In the Edit the Xpath expression, type : contains(@title,@ login)

    2.     Or you can use servervariables in your data view web part as parameters to get the user, here are the steps to access the variables:

    a)     On the “Common Data View Tasks pane” on your data view web part, click “Parameters”

    b)     Click “New Parameter”, name the parameter “ServerVar”, and set the “Parameter Source” to be “Server Variable

    c)     In the filter criteria, Field name: Title, Comparison: Contains, Value: ServerVar.

    d)     In “Server Variable Name”, enter in any of the available server variables. For example, use “LOGON_USER”. After this, “ServerVar” can be used as a parameter in the data view.

    e)     On the “Common Data View Tasks pane” on your data view web part, click “Filter”

    Hope it helps.


    Xue-Mei Chang
    Friday, October 30, 2009 6:15 AM
    Moderator