Need a way to search/filter a SharePoint list where user enters text hits Enter and list filters on that
WSS 3.0 and I have SharePoint Designer.I have a list of employee phone numbers.There are hundreds of people in this list and I need a way to add a text box above the list and allow people to enter a value, then hit enter and it will search on that.In a perfect world it would be a sort of auto complete box for the employee name.So I could type in "Smith" hit enter and the list would filter down only to show last name contains "smith".I can't seem to find a way to make that happen with SharePoint designer.
February 6th, 2009 9:18pm

There's a standard web part called the Form Web Part. (WSS 3.0 and MOSS 2007)It consists of a single entry box with a Go button.Put it on a page along with the web part of your List. Then use web part connections to connect the two.Enter a value in the Form Web Part and the web part of the list will display only the matching rows.(I have a simple demo in my Teach Yourself SharePoint 2007 book (ca 4 pages in all) so I can confirm that the method works well.)-----------------Moving to Admin as this is no longer an SPD question.WSS FAQ sites: WSS 2.0: http://wssv2faq.mindsharp.com WSS 3.0 and MOSS 2007: http://wssv3faq.mindsharp.com Total list of WSS 3.0 and MOSS 2007 Books (including foreign language titles) http://wss.asaris.de/sites/walsh/Lists/WSSv3%20FAQ/V%20Books.aspx
Free Windows Admin Tool Kit Click here and download it now
February 6th, 2009 9:53pm

The problem is Form Web Part will filter only exact matches, so if you type "Smith", "Will Smith" will not appear in the current view. You can create a Data View and filter it with a value from Asp TextBox Control using a parameter (remember to select "Comparison -> Contains" when adding the filter). Check it at: http://demo.bartomolina.com/filteredDataView.aspx (type madrid or barcelona in the filter box). Blog de Barto MolinaMicrosoft MCP 6608632
February 7th, 2009 1:23pm

True, but>So I could type in "Smith" hit enter and the list would filter down only to show last name contains "smith".Note that he sayslast nameand unless you have a very bad designof your list you will have separatefields for both Surnames (last name) and "Christian" names, so "Smith" *will* work.My guess based on his text is that he does have a Field called "Last Name" .....P.S. On the other side the counter argument is that he writes that 'the last name contains "smith"' which is a strange way to put it if the field contains only a surname ...So which was it, Ars-Maxer ? WSS FAQ sites: WSS 2.0: http://wssv2faq.mindsharp.com WSS 3.0 and MOSS 2007: http://wssv3faq.mindsharp.com Total list of WSS 3.0 and MOSS 2007 Books (including foreign language titles) http://wss.asaris.de/sites/walsh/Lists/WSSv3 FAQ/V Books.aspx
Free Windows Admin Tool Kit Click here and download it now
February 7th, 2009 2:37pm

I'm looking for a matches/contains search.Last Name CONTAINS: Smior starts with, or whatever.So I'd get Smith, Smithson, Smith-Avery, McSmith, etc...The issue is with the form option that gives me the text field and the GO button it only does a perfect match / equals AND after it does the filter I can't find anyway to UNFILTER other than having them re-load the list.I was really hoping for a field to just sit there, let me type and then hit enter or "search" and it would update the list by applying that type of filter to it.Then if I had a "clear filter" button or something as well that would be ideal.
February 11th, 2009 12:27am

Did you have an example that shows the steps to putting that ASP.NET filter together as you dispalyed on your site?Thanks.
Free Windows Admin Tool Kit Click here and download it now
February 18th, 2009 4:14pm

Follow these steps:1. Insert a dataView: Insert --> SharePoint Controls --> Dataview, and select a source List2. Insert a TextBox and Button: Insert --> ASP.NET Controls --> TextBox/Button3. From the Common Data View Tasks menu select: Filter: and add a new Filter for the TextBox with these parameters: Field Name: Title Comparison: Contains Value: Create a new parameter... (Parameter source: Control, ControlID: textboxID) Blog de Barto MolinaMicrosoft MCP 6608632
February 26th, 2009 2:06pm

Thanks for directing me to this post it is exactly what I was looking for, but i must not be doing something right because I created the text box and button and I set the filter with the filed - Name because I am using a picture library, and I set the parameter to Control and the Control ID to textbox1 because that is what it is labeled as and I left the default value blank, but I get no results showing up in the list. is there something you need to do the text box or the button?
Free Windows Admin Tool Kit Click here and download it now
February 26th, 2009 10:39pm

nevermind it works now, I needed to do and IIS Reset.
February 27th, 2009 12:58am

Ok can this be done with a List View Web Part? There is no option to add a parameter to to the filter in SPD.**Nevermind I figured it out. Here are the steps1. Go into Edit Mode and Click Add WebPart then select the library you wish you add.2. Open page in Sharepoint Designer.3. Right Click on the List View Web Part and select "Convert to XSLT Data View"4. Then follow the steps above to create a new parameter pointing to the textbox.Make sure you set the AutoPostBack to true for the text box. If you want all of the files to display by defualt then what I did was just set the default value to the period mark '.' and that will display all the files for you until a new value is entered.
Free Windows Admin Tool Kit Click here and download it now
March 3rd, 2009 1:41am

Hi Nick,As far as I know you can only do that with a dataView. Why do you need to use a List View Web Part? Blog de Barto MolinaMicrosoft MCP 6608632
March 3rd, 2009 1:45am

Thanks for the reply Bartomolina, i edited my post becauseI figured out how to do it. But I needed a list view because we have a details library filled with files that people need access to and we wanted to create a filter/search function that allowed the user to type in text contained in the name to easily find what they need. There are over 600 files in the library so having them click through the library to find what they want wasnt going to work. What i posted above works perfectly though.
Free Windows Admin Tool Kit Click here and download it now
March 3rd, 2009 2:07am

I think it is a good solution. And i didn't knew the "period mark" trick...Regards, Blog de Barto MolinaMicrosoft MCP 6608632
March 3rd, 2009 2:14am

I have a Document Library that i am displaying in a web part. The only fields which will show in the webpart are Type,Name, and ModifiedBy. When i use the Form Web Part, to provide a filter to my doc library list, the only Consumer Field names available for the connection are Type and Modified by. Ultimately, i want to use a web part as a provider, and i will want to filter on fields other than these only two which are showing up. But for now, i would be happy to have the Form Web Part send its value to be filtered using the name field of the document library. Do you know how i could get this to work?
Free Windows Admin Tool Kit Click here and download it now
June 10th, 2009 6:30pm

you will need sharepoint designer to change the fields that are displayed. When you open the page in SPD you will see the "list view options" box when you click on your webpart. in there select change fields, you can also sort and group the items however you want. if you want to be able to filter it with a textbox or some other selection like a radio button or drop down menu then you will need to convert the webpart to XSLT data view. you do that by rigth clicking on the webpart and you will see the option to convert. Once you do that you can instert asp .net controls and create parameters and filters based on those controls. The posts above explain how to use a textbox. Otherwise you can use business data catalogs which aren't that easy to create unless you are really fast at xsl programming or have something like BDCMetaMan.
June 10th, 2009 6:56pm

I can't seem to get this to work. I have the asp:Textbox, and asp:buttons in there. The list is filtered based on Param1. Up to this point, it seems to be working correctly, because if I set a default value to Param1, the search goes fine. When I type something into the textobx and click the button, nothing happens. It still seems to be searching by the default value for Param1. I suspect that the Param isn't connected to the TextBox1, because even if I change the name of the control to something that doesn't exist, the filter still seems to be searching by the default value. I have Parameter Source: Control ControlID: TextBox1 (this is the id of the asp:Textbox) Default Value: but (this gives me one result when the page loads, because I have a list item that talks about "buttons". So it really looks like the filter is connecting to the Param1 ok. And Param1's default value seems to be functioning. But the ControlID field doesn't seem to do anything. I thought that maybe there was a naming conflict in the id, so I tried changing the id of the textbox, then changing it in the param, and it still doesn't work.
Free Windows Admin Tool Kit Click here and download it now
May 25th, 2010 7:21pm

Upon further investgation, I found that it seems to have something to do with the way forms post back when they're inside/outside of web parts? I tried creating an aspx page that just holds this one DataFormWebPart without any web part zones. I wrap the dataFormWebPart with the form and buttons. <form id="form1" runat="server"> [web part goes here] <asp:TextBox runat="server" id="TextBox1" AutoPostBack="True"/> <asp:Button runat="server" Text="Search the FAQS" id="Button1"/> </form> This method works when it's the only thing on the page, but I don't like this solution. Is there a way to do this with the buttons inside of the web part? I'd like it to all be part of a single web part so that I can export it as a single unit. I also suspect that due to the nesting of the form/webParts, the parameterBinding isn't smart enough to find what it's looking for? <ParameterBinding Name="Param1" Location="Control(TextBox1)" DefaultValue="but"/>
May 25th, 2010 9:50pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics