Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 03, 2013 @ 13:57
    Fuji Kusaka
    0

    Conditional Transformed XSLT

    Hi guys,

    I have some issues with a automatic email response with contour when user submit and completes the form.

    We have a field with a checkbox list Yes / No and depending on this entry the user will get a specific message.

    So if user check the Yes Check box he will receive some instructions and if No is checked then something else will be displayed.

    I tried the following but not working, any idea how to achieve this ? 

      <xsl:for-each select="$records//fields/child::* [caption = 'sendit']//value">
                    <xsl:choose>
                        <xsl:when test="substring(./value,1,1)='Oui / Yes'">
                            Send the instructions
                            <xsl:value-of select="."/>
                        </xsl:when>
                        <xsl:otherwise>
                           Do not send instructions
                        </xsl:otherwise>
                    </xsl:choose>                  
                </xsl:for-each>
  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Sep 03, 2013 @ 14:19
    Chriztian Steinmeier
    0

    Hi Fuji,

    A couple of things wrong here:

    1. You're iterating a set of <value> elements - but you're then checking the <value> child of everyone of those?
    2. The function substring(something, 1, 1) will give you a 1-character string — that will never be equal to a multi-character string

    I don't know exactly how the Contour XML looks - maybe you could post just a couple of fields so I can have a look?

    /Chriztian

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 03, 2013 @ 14:27
    Fuji Kusaka
    0

    Well am not sure how this will work, basically i need to display some text depending on what user chooses.

    If Yes he will get some text from the xslt transformed email and if not something else. 

     

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 04, 2013 @ 13:57
    Fuji Kusaka
    100

    Got this working.

     <xsl:param name="records"/>
        <xsl:template match="/">
            <xsl:variable name="employee" select="$records//fields/child::* [caption = 'do you want to get the steps']//value"/>

                <xsl:for-each select="$records">
                   
                <xsl:choose>
                    <xsl:when test="$employee = 'Oui / Yes'">                  
                        Steps displayed
                    </xsl:when>
                    <xsl:otherwise>                  
                       No Steps
                    </xsl:otherwise>
                </xsl:choose>
                </xsl:for-each>         
           
        </xsl:template>

     

    //fuji

Please Sign in or register to post replies

Write your reply to:

Draft