Copied to clipboard

Flag this post as spam?

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


  • Aaron Powell 1708 posts 3046 karma points c-trib
    Jan 20, 2011 @ 01:30
    Aaron Powell
    0

    Record ID

    Is there any way to export a record set from a form and include the ID of the record?

    I need some way to uniquely identify each record in the export. Alternatively is there a field I can use to generate the ID and include in my record set

  • Comment author was deleted

    Jan 20, 2011 @ 09:21

    Hi,

    Should be possible with a simple xslt update, all export types are basicly xslt transformations

    You can find the xslt files that are used in the \umbraco\plugins\umbracoContour\xslt directory

    /excel.xslt
    /Html.xslt
    /xml.xslt

     

  • Comment author was deleted

    Jan 20, 2011 @ 09:24

    It is included in the xml export

    So should be an easy update if you want to add it to the excell or html export (the id child element of each uformrecord element)

     

    - <uformrecords formname="Contact" formid="4c2cfbb0-7d41-456f-a7d0-58684fd22a56" created="20/01/2011 09:23:14">
    - <uformrecord>
      <state>Approved</state>
      <created>2011-01-13T11:03:40</created>
      <updated>2011-01-13T11:03:40</updated>
      <id>6f22df8f-88f3-4dce-a0cd-0800feaadb46</id>
  • Aaron Powell 1708 posts 3046 karma points c-trib
    Jan 20, 2011 @ 09:55
    Aaron Powell
    0

    Cool, easy does it

  • Yarik Goldvarg 35 posts 84 karma points
    Apr 09, 2012 @ 16:57
    Yarik Goldvarg
    0

    Hi this is my excel.xml

    I what to get Record Id on "Save to excel".

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    xmlns:user="urn:my-scripts">    
        
        <xsl:output method="text" indent="no" encoding="utf-8" />
    
        <xsl:param name="records" />
        
    <xsl:template match="/">
    "State","Submitted","PageId","IP","MemberId",<xsl:for-each select="$records//uformrecord[1]/fields/child::*"><xsl:sort select="caption" order="ascending"/><xsl:if test="position() != last()">"<xsl:value-of select="normalize-space(translate(caption,',',''))"/>",</xsl:if><xsl:if test="position()  = last()">"<xsl:value-of select="normalize-space(translate(caption,',',''))"/>"<xsl:text>&#xD;</xsl:text></xsl:if></xsl:for-each>
    <xsl:for-each select="$records//uformrecord">"<xsl:value-of select="state"/>","<xsl:value-of select="updated"/>","<xsl:value-of select="pageid"/>","<xsl:value-of select="ip"/>","<xsl:value-of select="memberkey"/>",<xsl:for-each select="./fields/child::*"><xsl:sort select="caption" order="ascending"/><xsl:if test="position() != last()"><xsl:choose><xsl:when test="count(values//value) &gt; 1">"<xsl:for-each select="values//value"><xsl:if test="position() != last()"><xsl:value-of select="normalize-space(translate(.,',',''))"/>;</xsl:if><xsl:if test="position() = last()"><xsl:value-of select="normalize-space(translate(.,',',''))"/></xsl:if></xsl:for-each>",</xsl:when><xsl:otherwise>"<xsl:value-of select="normalize-space(translate(values//value,',',''))"/>",</xsl:otherwise></xsl:choose></xsl:if><xsl:if test="position() = last()"><xsl:choose><xsl:when test="count(values//value) &gt; 1">"<xsl:for-each select="values//value"><xsl:if test="position() != last()"><xsl:value-of select="normalize-space(translate(.,',',''))"/>;</xsl:if><xsl:if test="position() = last()"><xsl:value-of select="normalize-space(translate(.,',',''))"/></xsl:if></xsl:for-each>"</xsl:when><xsl:otherwise>"<xsl:value-of select="normalize-space(translate(values//value,',',''))"/>"</xsl:otherwise></xsl:choose><xsl:text>&#xD;</xsl:text></xsl:if></xsl:for-each>
    </xsl:for-each>
    
        
    </xsl:template>
        
       
     
    </xsl:stylesheet>
Please Sign in or register to post replies

Write your reply to:

Draft