<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Auto generation field</title><link>https://community.appian.com/discussions/f/new-to-appian/23910/auto-generation-field</link><description>Hi, 
 I&amp;#39;ve been creating an application for onboarding clients. For this I want to create an auto generated field in CDT. whenever a new client register for onboarding and successfully submits the form, automatically the unique onboarding number have</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Auto generation field</title><link>https://community.appian.com/thread/92024?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2022 14:41:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:eeb85956-076d-4e52-9368-4d6a0131f2a1</guid><dc:creator>Nithyasri</dc:creator><description>&lt;p&gt;Thank you for your valuable reply... It works well&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Auto generation field</title><link>https://community.appian.com/thread/92018?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2022 11:36:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:45b25c16-6a64-4062-972a-71ef89ce6f14</guid><dc:creator>viratyogi</dc:creator><description>&lt;p&gt;Hi in order to autogenerate the value in any column (in normal use case it is the primary key of the CDT &amp;quot;id&amp;quot;) use @GeneratedValue annotation in the xsd&lt;/p&gt;
&lt;p&gt;in the database table mark the value as autoincrement.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This will create a new autoincrement value each time a transaction is made.&lt;/p&gt;
&lt;p&gt;It should look something lie this&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;xsd:element name=&amp;quot;appianColumnName&amp;quot; nillable=&amp;quot;true&amp;quot; type=&amp;quot;xsd:int&amp;quot;&amp;gt;
        &amp;lt;xsd:annotation&amp;gt;
          &amp;lt;xsd:appinfo source=&amp;quot;appian.jpa&amp;quot;&amp;gt;@Id @GeneratedValue @Column(name=&amp;quot;databaseColumnName&amp;quot;, nullable=false, unique=true, columnDefinition=&amp;quot;INT&amp;quot;)&amp;lt;/xsd:appinfo&amp;gt;
        &amp;lt;/xsd:annotation&amp;gt;
      &amp;lt;/xsd:element&amp;gt;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Auto generation field</title><link>https://community.appian.com/thread/92009?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2022 05:51:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ec8e904d-30f2-4b60-98a0-fd54418a4cde</guid><dc:creator>Nithyasri</dc:creator><description>&lt;p&gt;Thank you for your valuable reply&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Auto generation field</title><link>https://community.appian.com/thread/92000?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 21:39:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0c75761c-05d5-49d6-9cb5-3f4c62b92f9f</guid><dc:creator>ajhick</dc:creator><description>&lt;p&gt;I use this function when generating a unique identifier.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!raw: a!refreshVariable(
    value: concat(
      dec2hex(toint(rand(4)*256),2),
      &amp;quot;-&amp;quot;,
      dec2hex(toint(rand(2)*256),2),
      &amp;quot;-&amp;quot;,
      dec2hex(toint(rand(2)*256),2),
      &amp;quot;-&amp;quot;,
      dec2hex(toint(rand(2)*256),2),
      &amp;quot;-&amp;quot;,
      dec2hex(datetext(now(),&amp;quot;yyyy&amp;quot;),3),
      dec2hex(datetext(now(),&amp;quot;MMdd&amp;quot;),3),
      dec2hex(datetext(now(),&amp;quot;HHmm&amp;quot;),3),
      dec2hex(datetext(now(),&amp;quot;SSss&amp;quot;),3)
    ),
    refreshAlways: true
  ),
  local!rawLength: len(local!raw),
  concat(
    a!forEach(
      items: 1 + enumerate(local!rawLength),
      expression: a!localVariables(
        local!currentCharacter: index(
          local!raw,
          fv!item,
          {}
        ),
        if(
          a!isNullOrEmpty(
            stripwith(
              lower(local!currentCharacter),
              &amp;quot;abcdefghijklmnopqkstuvwxyz&amp;quot;
            )
          ),
          if(
            rand(1) &amp;lt; 0.5,
            lower(local!currentCharacter),
            local!currentCharacter
          ),
          local!currentCharacter
        )
      )
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Auto generation field</title><link>https://community.appian.com/thread/91988?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 10:31:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:725710e0-6609-4764-bcf3-c46eeaed024d</guid><dc:creator>Nithyasri</dc:creator><description>&lt;p&gt;Thank you for your valuable reply :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Auto generation field</title><link>https://community.appian.com/thread/91987?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 10:30:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5c52e7a0-47fa-4f36-b4e7-c7b80767112f</guid><dc:creator>Nithyasri</dc:creator><description>&lt;p&gt;Thank you for your valuable reply :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Auto generation field</title><link>https://community.appian.com/thread/91986?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 10:27:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:232eb014-df3e-4829-b3e3-a5f078591e08</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;So to be clear: you want to auto-generate a unique Reference Number for each onboarding process instance? The way I&amp;#39;ve done this in the past is to have a database table that stores a sequence number, and a stored procedure that increments and then&amp;nbsp;returns the sequence number. The actual reference number might be constructed from, say, a date and the sequence number itself e.g. 20220300005 - that is, the year 2022, the month of March (03) and sequence number 00005. Your stored proc would also determine if the currently stored sequence number is for a different month and, if so, reset the sequence to 1.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Using a table allows you re-use it for other sequence numbers for other contexts i.e. it could be a shared service across multiple applications.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Auto generation field</title><link>https://community.appian.com/thread/91985?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 10:25:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f589422e-4d1d-4765-994c-9822798191e1</guid><dc:creator>GopalK</dc:creator><description>&lt;p&gt;HI, You can create a field called &amp;quot;ID&amp;quot; in the CDT and while configuring you can check mark for Auto generation option.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>