Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a Data Form Web Part (DFWP) in SP2010 and need to filter one of the columns ("Department") on a value using the querystring. How do you do this?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Open the web part page that contains the web part in question.

In the web part parameters in Sharepoint Designer, you create a new query string parameter. Then you filter the web part so that your desired column is filtered by that parameter. Then you pass in the desired value in the query string and you should get the desired results.

share|improve this answer
2  
Adding to Eric's answer above, you can do everything he describes with the common dialogs. –  Marc D Anderson Jul 14 '11 at 14:04
    
Thanks, PirateEric. I navigated to the web part in Designer via Site Objects > All Files > _catalogs > wp. Then clicked on it, and chose "Edit File". However, it shows only the code view and there are no options for adding parameters (or much else). What am I doing wrong? Thanks. –  Alex C Jul 14 '11 at 14:05
1  
Open the page the web part is on and edit the web part there, not the web part from the catalogs folder. –  PirateEric Jul 14 '11 at 14:08
    
Okay. Thanks, PirateEric. Got to the parameter. However, the column I'd like to filter on has a space in it: "Infoweb Department". I've tried using "Infoweb_x0020_Department" and "Infoweb Department" for the Querystring name and setting the default value as "Accommodations", but the web part is replaced with "The server returned a non-specific error when trying to get data from the data source." What am I doing wrong? –  Alex C Jul 14 '11 at 14:23
1  
When you define the QS parameter, the name you give it is what you use in the Filter dialog box, so Infoweb Departmet equals [param1] for example. The query string variable is what the web part will be looking for in the url, dept for example. So I'd end up passing in something like ...MyPage.aspx?dept=IT and this should show a filtered list of all IT listings in the Infoweb Department column. –  PirateEric Jul 14 '11 at 15:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.