i have a list and a doc library. the list has a multi-select lookup field to the ID field in the doc library. when a user chooses multiple values in the dispform.aspx list form, i want to display the corresponding documents beneath it. so, if a user selects #24, #689, in the multi-select list field, the documents whose ID is equal to 24 and 689, would show up below it (in a data view web part). for the life of me i cannot get this to work. The field looks like this... @PeerReview_x002d_ID. The multiple values stored inside of it are stored as "24;689". how do i split out the values so that i can set the filter in the data view web part to "ID=24" or "ID=689" and NOT "ID=24;689"?


In case you're still looking for a resolution for this I do something similar. I have a multi-select column in a custom list and I need to display rows from a different list that match. The difference to your scenario is that I use an InfoPath form for the user's selection. Then I have a DVWP beneath the ListView that has data source connections to both lists: OperatorAreaOfResponsibility and Logbook. In this case @AreaOfResponsibility is the field containing the mult-select values. Then it's just about using XPath to filter the rows to display in the DVWP.

<xsl:variable name="loggedInOperator" select="$Operator"/>
<xsl:variable name="Aors" select="/dsQueryResponse/OperatorAreaOfResponsibility/Rows/Row[@OperatorName = $loggedInOperator]/@AreaOfResponsibility."/>
<xsl:variable name="Rows" select="/dsQueryResponse/Logbook/Rows/Row[@AorName != '' and contains($Aors, @AorName)]"/>

Multi-choice or Multi-lookup fields are not supported by the filter web parts, nor by DVWP, exactly because of the way these values are actually stored, however you could do use an "CONTAINS", but it is not really the same.

One alternative would be to use the QueryString technique as described here http://weblogs.asp.net/wkriebel/archive/2004/04/21/117558.aspx, but if that really doesn't fit the bill go for override the behaviour of the web part, using something like http://www.primordialcode.com/index.php/2009/09/02/wsssharepoint-create-custom-listviewwebpart/

  • 1
    can't create custom web parts. this has to be done using SPD on the client-side. – user14836 Feb 11 '13 at 21:23
  • 1
    all i'm trying to do is take the values from a multi-select field that look like this (xx;yy) and send them to a DVWP on the same page where ID=xx OR ID=yy. can anybody provide an approach to pursue? – user14836 Feb 11 '13 at 22:13

Not sure this would exactly help, but came across this solution using Compound Filtering within the Dataview Webpart.


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.