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 am trying to create a formula for a dataview that returns a URL using the xpath expression tool in SPD 2007. I can't really find any examples. Here is what I am trying to do (in pseudo code):

If @ColumnA='SomeValue' then

// build a link to a web page and display it in the column
'<a href=http://mysite/somePage.aspx?ParamB=' + @ColumnB + '&ParamC=' + @ColumnC + '>Complete Request</a>'


// display nothing in the column


The url should look like this:


and displayed in the dataview list column as a URL (if condition is true) labeled "Complete Request"

share|improve this question
up vote 0 down vote accepted

So the way I did this was to just add a simple formula column. Then, in the markup, I replaced what was added by the designer with this:

<xsl:when test="@OARP_x0020_Approval_x0020_Status='Initializing'">
    <td class="ms-vb">
        <xsl:element name="a">
            <xsl:attribute name="href">
                <xsl:value-of select="concat(concat('oracleResponsibilities.aspx?GUID=',@Guid_Id),concat('&amp;ID=',@ID))"/>
            <xsl:text>Complete Request</xsl:text>
    <td class="ms-vb"></td>

Basically, if the value of column "OARP Approval Status" is 'Initializing', then I construct the anchor tag. If "OARP Approval Status" is any other value, I just leave the table cell blank.

The following creates the anchor tag:

<xsl:element name="a"></xsl:element>

This sets the href attribute:

<xsl:attribute name="href">
    <xsl:value-of select="concat(concat('oracleResponsibilities.aspx?GUID=',@Guid_Id),concat('&amp;ID=',@ID))"/>

And this sets the display value fo the link:

<xsl:text>Complete Request</xsl:text>
share|improve this answer

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.