1

I am using a List View Web Part that will be on several different sites. I want the items shown to filter based on the title of the site the web part is on.

The scenario: I have a list of accounts and each account is under a Sales Territory, each territory has their own site. I want the list to show ONLY the accounts for that Sales Territory, however, I need something that I can use generically because these sales territory sites are created by a workflow and I can't go in and edit the view of every site created by the workflow so I'm looking for something that works like the [me] filter.

I am running SharePoint 2013 Online through Office 365. I have access to SharePoint Designer 2013.

Any options anyone can suggest are greatly appreciated.

1

Edit view filter to display items where [Sales Territory] == "Site title" for each web part. Or you can configuire web part to get params from URL or another web part. If you will decide to do it through Url param, you need to go to web part properties -> Edit view -> in filter tab choose your field and set value to {urlParamName}. Then open page in sharepoint designer and find tag <ParameterBindings> and append line <ParameterBinding Name="urlParamName" Location="QueryString(urlParamName)" />. Or if you can, add Standart web part "Query String (URL) Filter" from "Filters" category to do the same.

So, just add "?urlParamName=Territory" to page link and it will display what you want.

5
  • I tried your first suggestion and was not able to get it to work. I clicked on the Web Part and went to List > Modify View. I selected "Sales Territory" then "is equal to" and finally "Site title" I also tried "=Site title" and "[Site title]". None worked.
    – anonymous
    Aug 18 '16 at 15:40
  • For the Url param, I followed your steps but am not able to get the list to filter this way. As you said, I went into the Edit view by clicking on the Web Part and going to List > Modify View. I selected "Sales Territory" then "is equal to" and finally "{urlParamName}". I then opened SharePoint Designer and added the ParameterBinding tag to the top of the parameter bindings and added the "?urlParamName=Canada" to the link of my test site, no items displayed in the list. Am I missing a step or not completing something correctly?
    – anonymous
    Aug 18 '16 at 15:44
  • I just setup the Query String (URL) Filter and it worked!!! I will just add the "?Territory=_____" into my workflow where I set the URL! Thank you!
    – anonymous
    Aug 18 '16 at 16:33
  • will the ?urlParamName=Territory work if there is a space in the territory that the query is searching for? For example, one of our territories is "Northern California I" If I add this to the end of my URL in the workflow, I'm worried the url will only include "?urlParamName=Northern" and not "?urlParamName=Northern California I"
    – anonymous
    Aug 22 '16 at 18:41
  • 1
    It will work just try it, sharepoint decode encoding symbols like space become %20. Aug 23 '16 at 4:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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