1

I want to filter my dataview by url.

Example

Path to the publishing page with the Layout:

https://domain.com/customers/exampleA/pages/default.aspx.

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 
Street:street1 
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
0
  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.

| improve this answer | |

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.