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 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.

share|improve this question
add comment

1 Answer 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.

share|improve this answer
    
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 Feb 2 '12 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 Feb 2 '12 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. –  PirateEric Feb 2 '12 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 Feb 2 '12 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). –  PirateEric Feb 2 '12 at 18:50
show 2 more comments

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.