none
How can i Filter the document library based on parameter values??

Answers

  • Hi ,

    When you upload documents to a document library ,you can choose to upload this file to a different folder .The default way is to upload the file directly to the root folder ,that is represented by ‘/’ .You can change the destination folder when upload the document .

    In order to filter a data view web part using query sting ,you can create some parameters for the web part in SharePoint Designer .Click in the date view web part and choose Parameters under List View Tools ribbon .Set the parameter’ source as Query String .Set the parameter variable as DocumentCategory .Add another parameter and set the parameter variable to DocumentType .Then you can use the parameter to filter the web part .Click Filer in the ribbon to add filters .

    Thanks


    Entan Ming

    TechNet Community Support

    • Marked as answer by rakib1 Monday, April 02, 2012 8:39 PM
    Monday, April 02, 2012 8:56 AM
    Moderator

All replies

  • Hello!

    You can do it. Open list view in SPDesigner, select XsltListViewWebPart [1 on screenshot], on Parameters tab, click Parameters button [2 on screenshot].

    On appeared window click "New parameter", input parameter name and select "Query string" as source. Add required number of parameters. Close window by clicking OK.

    Click Filter button [3 on screenshot] and input field title, operator (Equal) and one of your parameters as value for each parameter.

    Screenshot (sorry for localized version of SPDesigner):


    Bond... Brooke Bond!


    • Edited by Aviw_ Sunday, March 25, 2012 8:17 AM
    • Proposed as answer by romeo doncaMVP Sunday, March 25, 2012 4:18 PM
    Sunday, March 25, 2012 8:14 AM
  • Hello Aviw,

    Thanks for your reply. As i said i have a document library with bunch of folders and lot of items inside of these folders. Basically i am trying to filter all items inside all of these folder based on parameter values. so should i create any view for all items first without folders and then i need to filter? Please let me know further.

    Thanks in advance

    Tuesday, March 27, 2012 2:13 PM
  • Hello!

    I don't understand your question partially...

    You can use filters and folders together, in any order.


    Don't happy, be worry...

    Tuesday, March 27, 2012 2:53 PM
  • Hi ,

    You can need to create a new view which displays all the items without folder .Add data view web part of the list on a web part page ,then edit the view of the data view web part  to the newly created view in browser .Then you can add filter to the view to achieve what you want .

    Thanks


    Entan Ming

    TechNet Community Support


    Wednesday, March 28, 2012 1:27 AM
    Moderator
  • Hi Entan,

    Thanks for your reply again. As i said i have bunch of folders in my document library And each folder has lots of items inside of those folders. Lets say i have these Url with parameter values http://server/sites/test/adm/Test/Forms/AllItems.aspx?OperatingUnit=KAN&DocumentCategory=Project&DocumentTyep=ProDoc&ProjectNumber=0008766. so based on these parameter values i want to search all folders, once query will get result it will populate all items from folders related with that url parameter values. is that possible to search folders items in document library based on parameter values. if yes please let me know steps that will be appreciated.

    Thanks

    Thursday, March 29, 2012 4:26 PM
  • I too, am having trouble understanding what you are trying to do. I am assuming you have multiple columns that are being used to filter on?

    It may be easier to just list the columns you have and how you are hoping to filter this list.


    Stunpals - Disclaimer: This posting is provided "AS IS" with no warranties.

    Thursday, March 29, 2012 7:22 PM
  • Hi, Here is details, so if you look at the above picture you will see i have folders and in the Url i have Parameter values same as this  http://server/global/pdc/Test/Forms/AllItems.aspx?DocumentCategory=Programme&DocumentType=NDAF.  so i am wanting based on these parameter values if (DocumentCategory=Programme&DocumentType=NDAF) then it will filter all those folders, once it will find items with matching parameter values then it will returned items related with those parameter values. It will return like following screenshot. FYI i am able to filter items based on parameter values when i am inside of any folder but not outside of the folder. just i am using OOB query string filter web part but it only works inside of folder.

    Thanks


    • Edited by rakib1 Thursday, March 29, 2012 9:03 PM
    Thursday, March 29, 2012 8:58 PM
  • I think someone mentioned this already but you'll need to:

    1. Create a new
    2. select your columns you want
    3. Under the Folders heading select "Show all items without folders"
    4. Under the Filter heading set your filters
    5. DocumentCategory is equal to Programme
    6. DocumentType is equal to NDAF
    7. Confirm the AND radio button is selected between the Filters above

    I think this is what you are looking for? A predefined view that filters (displays) only documents that are Programme & NDAF.


    Stunpals - Disclaimer: This posting is provided "AS IS" with no warranties.

    Thursday, March 29, 2012 10:02 PM
  • Hello Stunpals,

    Thanks for your reply. yeah you are right i can create another view which will show all items only. but problem is if i upload any document and save that document in that view. This items will be saved outside of all folder (where is all folders in allitems.aspx page) but i want to save items inside of particular folder. is that possible??

    Sunday, April 01, 2012 8:46 PM
  • Hello Entan,

    If i create a view for items only without folder. Eventually it will give me all items of all folders but problem is if i upload any document and saved that document, item is saving outside of folder not inside of particular folder. so is there anyway i can save items to particular folder. lets say i am uploading document for Belgium folder and items should save inside of Belgium folder. i can save items to particular folder but for that i have to click on that particular folder and then i can upload.

    please let me know if you have any idea!!

    Appreciated for your help.

    Sunday, April 01, 2012 8:54 PM
  • Hi ,

    When you upload documents to a document library ,you can choose to upload this file to a different folder .The default way is to upload the file directly to the root folder ,that is represented by ‘/’ .You can change the destination folder when upload the document .

    In order to filter a data view web part using query sting ,you can create some parameters for the web part in SharePoint Designer .Click in the date view web part and choose Parameters under List View Tools ribbon .Set the parameter’ source as Query String .Set the parameter variable as DocumentCategory .Add another parameter and set the parameter variable to DocumentType .Then you can use the parameter to filter the web part .Click Filer in the ribbon to add filters .

    Thanks


    Entan Ming

    TechNet Community Support

    • Marked as answer by rakib1 Monday, April 02, 2012 8:39 PM
    Monday, April 02, 2012 8:56 AM
    Moderator
  • You can pass FilterValues to the document library to perform ad-hoc filters.  Simply pass the filters like this:

    http://[site_URL]/lists/contacts/AllItems.aspx?FilterField1=FirstName&FilterValue1=Something

    More info here: http://www.sharepointboris.net/2008/02/quickly-filter-a-listdocument-library-view-using-url/

    Monday, June 18, 2012 9:19 PM