1

I have a joined DVWP.

List A includes a "category" lookup field among other columns. List A includes the same "category" lookup field as well as a People/Groups field with multiple selections.

I'd like to filter the joined DVWP such that it only shows items where [Current User] equals one of the names in the People/Groups field with multiple selections.

The DVWP will be further filtered with a URL Query String but that functions just fine.

1 Answer 1

1

You should be able to select that through the filter option the when building the data view web part. Find the person/group field in the Filter box, you may have to click on the More Fields link, and set that to equals Current User.

Even if it's a multiselect, it will still find the user if they are solely listed or are one of multiple people listed.

7
  • I certainly thought that would be the case. Using the DVWP filter doesn't work - I have it set for [People Field] EQUALS [Current User] OR [People Field] CONTAINS [Current User]. "Pre-filtering" List B in the linked data source options also doesn't seem to work.
    – Cory M
    Commented Feb 2, 2012 at 18:30
  • I know $UserID can be a fickle variable - the XPath looks something like this: [contains(../../../[List Name]/Rows/Row/@[Field Name], $UserID)]
    – Cory M
    Commented Feb 2, 2012 at 18:36
  • I know if you back it out to a singular list and just do p/g equals [current user] it works. Is that throwing any errors or is it just not filtering? I'll see if I can make a rudimentary recreation of your example. Commented Feb 2, 2012 at 18:38
  • I've tested it with/without the [Current User] (just with my own account) - EQUALS returns nothing and CONTAINS returns everything (apparently ignoring the filter?) - no errors. Works beautifully for standard lists but this joined character is giving me all sorts of trouble.
    – Cory M
    Commented Feb 2, 2012 at 18:44
  • Ah, let me look up something else. I think you might need to do some manipulation to get it to work properly. Now to find where I used that code (substring parsing of a P/G field to get the Users ID and filter a DVWP with it). Commented Feb 2, 2012 at 18:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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