Copied to clipboard

Flag this post as spam?

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


  • Steve 472 posts 1216 karma points
    Oct 07, 2014 @ 16:58
    Steve
    0

    XSLT Transformed Email Field Sort Order

    I am using the workflow "Send XSLT transformed extended email" with Contour and if I use the macro as a user control the order of all my fields get mixed up, but they are correct if I use the "Razor" macro. I can't use the Razor one, as it doesn't display uploads or the calendar picker.

    How can I get my fields in the same order as they appear in the form?

  • Steve 472 posts 1216 karma points
    Oct 07, 2014 @ 17:07
    Steve
    100

    This did the trick:

    <xsl:for-eachselect="$records//fields/child::*">
    <xsl:sortselect="./@pageindex"order="ascending"/>
    <xsl:sortselect="./@fieldsetindex"order="ascending"/>
    <xsl:sortselect="./@sortorder"order="ascending"/>
    <!--Do stuff-->
    </xsl:for-each>
  • Jamie Attwood 201 posts 493 karma points c-trib
    Feb 23, 2016 @ 21:44
    Jamie Attwood
    0

    I am using contour 3.0.17 and the above sortselects does in fact change the order of the fields, but not in the order which they appear on the form. I am using a 2 page form set up. Despite various configurations of the above ascending/descending, I just can't make this work! Anyone have any other ideas? It would be nice to be able to ouput the xsl at least so we can see exactly what is going on under the covers!

    Thanks in advance!

    Jamie

  • Jamie Attwood 201 posts 493 karma points c-trib
    Feb 24, 2016 @ 00:41
    Jamie Attwood
    1

    Steve, thanks for the trick, there is some formatting issues on your post as it looks like spaces were stripped from your code block. There should be some spaces between sort and select. Also had to cast the data as numbers to make this work for me:

    <xsl:for-each select="$records//fields/child::*">
    <xsl:sort select="./@pageindex" order="ascending" data-type="number"/>
    <xsl:sort select="./@fieldsetindex" order="ascending" data-type="number"/>
    <xsl:sort select="./@sortorder" order="ascending" data-type="number"/>
    
    <!--Do stuff-->
    
    </xsl:for-each>
    
Please Sign in or register to post replies

Write your reply to:

Draft