SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I see this difference when I'm working with lists in Data View Web Parts and manipulating the values in XSL. Why do some Lookup column values look like '1;#text' and others just have the text? I've never been able to figure that out.

It may have something to do with the Site Definition, but I'm just guessing. I've seen this difference in both SharePoint 2007 and 2010.

Right now I'm working in 2007, with lookups to Title columns in other lists. In this case, I don't have the ID;#. It seems to be consistent within installations.

Generally speaking, I would always prefer to see the ID;#, as I can then do much more reliable matching in my AggregateDataSources than if I have to use the text values.

share|improve this question
I've never seen one without the delimiter. When are you seeing these? Or where? Do you have examples? – RJ Cuthbertson Jul 31 '12 at 14:19
I added some clarification above. – Marc D Anderson Jul 31 '12 at 14:25
If you access the same LookUp column from the server object model does it return the same value? – RJ Cuthbertson Jul 31 '12 at 14:28
I've seen… and… about DVWP returning a link to the column. – RJ Cuthbertson Jul 31 '12 at 14:29
Can you do a "GetList" call on the list that is affected and a list that isn't? Maybe comparing the fields, something may show up in there. – iOnline247 Jul 31 '12 at 14:30

Use this:

<xsl:value-of select="substring-after(@Manufacturer.,'#')"/>

instead of

<xsl:value-of select="Manufacturer."/>

for the look up column

share|improve this answer

From what I've read about LookUp columns and DVWP, in DVWP (and only in DVWP) LookUp columns get returned as a link to the column and the actual value (rather than the delimited value).

The data stored in the SPListItem still has the delimited value internally. It is not however surfaced in the DVWP.

It's just an illusion that the data is not stored as such.


Inserting Lookup columns into Data View Web part displays as XML

share|improve this answer
I added yet more info above. I'd really like to always see the ID;#. – Marc D Anderson Jul 31 '12 at 14:59
But that's not how the DVWP works. The data is stored internally like you want it, but the DVWP renders it like you're seeing it. It's a behavior of the DVWP not the SPListItem. – RJ Cuthbertson Jul 31 '12 at 15:00
Your question is "Why is it like this?" This is the answer. – RJ Cuthbertson Jul 31 '12 at 15:01
I think you're answering a different question than I'm asking. I'm writing my own XSL in the DVWP, not just clicking on buttons in the ribbon. In some environments I see the ID;# in lookup column values and in others I don't. I'm wondering why there;s a difference. – Marc D Anderson Jul 31 '12 at 15:24

Your Answer


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.