0

I have the following code in XSLT and I get the Id of "Evaluacion" lookup field with @EvaluacionIDLookup. I need to get the name of "Evaluacion" but the internal name is "EvalCompeEvaluacion" and if I set @EvalCompeEvaluacion intead I get a strange code.

</td><td class="ms-vb styleLine">
                <xsl:value-of select="@EmpleadoCargoLookup" /></td><td class="ms-vb styleLine" style="text-align:center; width: 90px;height:22px;">
                <xsl:choose>
                    <xsl:when test="@RespuestaJSON != ''">
                        <a>
                            <xsl:attribute name="href">
                                <xsl:text>#</xsl:text>
                            </xsl:attribute>
                            <xsl:attribute name="onclick">
                                <xsl:text>javascript:EC.Empleados.ForEvaluation.ViewReport(</xsl:text>
                                <xsl:value-of select="translate(translate(@EmpleadoCedulaLookup,'.',''),',','')"/>,
                                <xsl:value-of select="translate(translate(@EvaluacionIDLookup,'.',''),',','')"/>
                                <xsl:text>);return false;</xsl:text>                        
                            </xsl:attribute>
                            <img src='/_layouts/images/DATASET_SP16.gif' alt='Ver reporte de evaluación' style="border-style: none"/>
                        </a>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:text></xsl:text>
                    </xsl:otherwise>
                </xsl:choose>
            </td>

enter image description here

1

As lookup column/field is stored as id value pair in sharepoint so you could try to use

<xsl:value-of select="@LookUpField" disable-output-escaping="yes"/>

It is worth trying although using a combination of substring-before and substring-after function like this.First step is to remove the hyperlink around the Lookup column then extract values from there-

<xsl:value-of select="substring-before("&le;/a&gt;", substring-after("*&quot;&gt;", @LookUpField))" disable-output-escaping="yes"/>
  • I try with EvalCompeEvaluacion but It does not work – Sebastián A Dec 14 '15 at 15:52
  • what is your actual lookup column name? – user13408 Dec 14 '15 at 15:55
  • It is the first in the image. Display name "Evaluación" and the internal name is "EvalCompeEvaluacion" but if I put @EvalCompeEvaluacion It does not work – Sebastián A Dec 14 '15 at 15:59
  • In the code that I posted I have @EvaluacionIDLookup that is the las field in the image but I need "Evaluación" – Sebastián A Dec 14 '15 at 16:04
  • Tried <xsl:value-of select="@Evaluación" disable-output-escaping="yes"/> ?? Also now I suspect ó character. – user13408 Dec 14 '15 at 16:08

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.