<?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>Custom Auto-Generated Sequences in Appian</title><link>https://community.appian.com/discussions/f/process/25567/custom-auto-generated-sequences-in-appian</link><description>Hi 
 I started working from the last month as Appian developer 
 Need help or suggestion 
 Tying to implement custom autogenerated primary key in sequence. 
 Example - INVREQ0001 , INVREQ0002 and so on. 
 If someone knows how to generate this then please</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Custom Auto-Generated Sequences in Appian</title><link>https://community.appian.com/thread/99896?ContentTypeID=1</link><pubDate>Mon, 22 Aug 2022 11:28:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b9a7966a-f155-4e38-8ce2-ce42a4422d60</guid><dc:creator>yogeshc213832</dc:creator><description>&lt;p&gt;Hi Chris&lt;/p&gt;
&lt;p&gt;Thanks for the reply.&lt;/p&gt;
&lt;p&gt;Actually, I found one example and tried to do the same in the below way.&lt;/p&gt;
&lt;pre&gt;create function CustomerNumber (@id int) 
returns char(5) 
as 
begin 
return &amp;#39;C&amp;#39; + right(&amp;#39;0000&amp;#39; + convert(varchar(10), @id), 4) 
end&lt;br /&gt;&lt;br /&gt;But the above function is not working in the appian clould database.&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Auto-Generated Sequences in Appian</title><link>https://community.appian.com/thread/99784?ContentTypeID=1</link><pubDate>Fri, 19 Aug 2022 15:21:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5f0f63f3-c012-468d-adae-216cbd17a925</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;As Stefan suggests, I would&amp;nbsp;let the DB auto-increment an integer primary key, then format it this way to display for the user.&amp;nbsp; You can even save the formatted text back to the DB based on the primary key if you want.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;a!localVariables(
  local!id: 2,
  
  concat(
    &amp;quot;INVREQ&amp;quot;,
    repeat(4-len(local!id),&amp;quot;0&amp;quot;),
    local!id
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Or, with similar logic, store the ID value (integer) in a constant within the application, at the start of each request, use the &lt;a href="https://docs.appian.com/suite/help/22.2/Increment_Constant_Smart_Service.html"&gt;Increment Constant smart service&lt;/a&gt; to increment it and pull the new value to format into the ID value with &amp;quot;INVREQ__&amp;quot;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Auto-Generated Sequences in Appian</title><link>https://community.appian.com/thread/99761?ContentTypeID=1</link><pubDate>Fri, 19 Aug 2022 08:36:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:19aedb57-d765-4c82-82e9-9f445cd1258f</guid><dc:creator>yogeshc213832</dc:creator><description>&lt;p&gt;its read-only field&lt;/p&gt;
&lt;p&gt;I only want to create this on the database side.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Auto-Generated Sequences in Appian</title><link>https://community.appian.com/thread/99758?ContentTypeID=1</link><pubDate>Fri, 19 Aug 2022 08:25:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:800733a3-1bf0-4025-818f-19ab345e8245</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Does this need to be stored in the database or can it be just showed to the user this way?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Auto-Generated Sequences in Appian</title><link>https://community.appian.com/thread/99755?ContentTypeID=1</link><pubDate>Fri, 19 Aug 2022 08:07:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0c3ebe4f-6bb3-4bd2-8cca-2ca0d65f4e2d</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;Hi there,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think that is possible. Tho you can do it with plain numbers, with a jump too e.g. 10,20,30...n (after 22.3) but mashing it up with some custom characters will be not straightforward.&amp;nbsp;&lt;br /&gt;So you will have to check for the last data in the table, add one to it and then concat your characters.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>