开发者

Can the ID from a referenced column be obtained when using SharePoint's Data View Part?

开发者 https://www.devze.com 2022-12-25 01:22 出处:网络
I have a Data View Part pulling from a list that has a lookup column to another list (title linked by ID)

I have a Data View Part pulling from a list that has a lookup column to another list (title linked by ID)

And somewhere in the XSLT of the data view web part configurati开发者_运维知识库on, it reads

<xsl:value-of select="@ColumnX"/>

Now since ColumnX is a reference to another list (linked to item), how do I go about obtaining the ID rather than the text? Is there a ddwrt trick out there?


The value of a Lookup Field is in the format of "ID;#Text". To get the ID value, we use is regular xslt:

<xsl:value-of select="substring-before(@ColumnX, ';#')" />
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号