I want to filter my dataview by url.


Path to the publishing page with the Layout:


In the Sharepoint Designer Layout of the dafault.aspx I inserted a Dataview with a list in which the Customer information looks like this, there is also a field with the path to the Dashboard:

company: exampleA 
pathtodashboard: exampleA

So I want to display only the exampleA's information in the default.aspx

What I have done, I made variables to get the URL path after "customers":

<xsl:variable name="custompath1" select="substring-after($CurrentUrl, 'customers/')"></xsl:variable>
<xsl:variable name="custompath" select="substring-before($custompath1, '/')"></xsl:variable>

So when I made the output <xsl:value-of select="$custompath"/> it takes the correct path "exampleA".

So how can I filter my dataview of the customer list, just to select the customer "exampleA"?

It doesn't work with the filter GUI.

  • You'd need to find the section in your template where the $Rows variable is defined and do something like $Rows[@company = $custompath] I believe. – Eric Alexander Apr 22 '16 at 13:23
  1. Edit the page
  2. Edit webpart property
  3. Click on Edit the current view.
  4. Filter with specific column with exampleA.
  5. Save it.

If above solution is not working for you, you can use Query String (URL) Filter webpart. It will work.

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.