<?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>Generate Case Number</title><link>https://community.appian.com/discussions/f/rules/17712/generate-case-number</link><description>Hello Guys, 
 I would like to change my rule for generating of case number. 
 At this moment I&amp;#39;m using something like this 
 &amp;quot;APP&amp;quot; &amp;amp; text(now(),&amp;quot;yy&amp;quot;) &amp;amp; text(now(),&amp;quot;mm&amp;quot;) &amp;amp; text(now(),&amp;quot;dd&amp;quot;) &amp;amp; &amp;quot;-&amp;quot; &amp;amp; ri!request.id, 
 where id is id of my case in DB. This</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Generate Case Number</title><link>https://community.appian.com/thread/69873?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 19:47:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:46156210-6aad-444c-9ac0-b751fc1e6393</guid><dc:creator>Robert Shankin</dc:creator><description>&lt;p&gt;Not bad, Chris.&amp;nbsp; I am corrected.&lt;/p&gt;
&lt;p&gt;So there&amp;#39;s a small expression needed to obtain the value of the constant in order to properly reset it in this way.&lt;/p&gt;
&lt;p&gt;I might do this next time.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generate Case Number</title><link>https://community.appian.com/thread/69871?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 18:38:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7ce5ae4f-f058-4368-a882-a5237ae0d0e8</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;To add,&amp;nbsp;for retaining&amp;nbsp;scalability when resetting the constant&amp;nbsp;I&amp;nbsp;would recommend&amp;nbsp;utilizing the Increment Constant node with a negative value (the negative value of the constant) to reset to 0, then perform the increment to get the first value (1) for the day, and no versions will be logged, vs using the Update Constant node to reset which would log a version each day.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generate Case Number</title><link>https://community.appian.com/thread/69870?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 18:28:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fdd8f181-4cd4-4ee7-abf5-3d36a549fa36</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Hi Robert, to note in my experience Appian does not save a version to memory of a numeric constant that is incremented using the Increment Constant node so this is scalable.&amp;nbsp; Constant versions are saved during manual updates, or when a constant is modified using the Update Constant node.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generate Case Number</title><link>https://community.appian.com/thread/69869?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 17:26:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ca6f16c0-7dd9-48a6-93ba-1f6491f032bc</guid><dc:creator>Robert Shankin</dc:creator><description>&lt;p&gt;Remember Appian saves previous versions of constants when they are changed.&amp;nbsp; This uses memory.&lt;br /&gt;The constant approach suggested above is easy to build, but it may not scale well over time.&lt;br /&gt;&lt;br /&gt;I&amp;#39;d use a variant of what&amp;nbsp;&lt;a href="/members/stewart.burchell"&gt;Stewart Burchell&lt;/a&gt;&amp;nbsp;recommends.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generate Case Number</title><link>https://community.appian.com/thread/69868?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 17:16:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:421d52d2-8f29-4823-a072-4fbaf0da0914</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Another option here would be to utilize a constant for the daily&amp;nbsp;ID value, create a sub process that gets this information for each record.&amp;nbsp; Assuming you have a &amp;#39;CreatedOn&amp;#39; timestamp for each record, the sub process can query the DB to see if any requests have been created in the same day.&amp;nbsp; If not, reset the constant to 1 and return that value.&amp;nbsp; If so, increment the constant and return the incremented value.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generate Case Number</title><link>https://community.appian.com/thread/69792?ContentTypeID=1</link><pubDate>Tue, 08 Oct 2019 11:34:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:10107319-57ee-4263-bd68-4eb1e794b43c</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;Hi Dawid&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve done this before in the following way:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;create a database table that holds the current value if &amp;#39;id&amp;#39;. Initially set the value to 1&lt;/li&gt;
&lt;li&gt;alongside this value have another column that holds a date value&lt;/li&gt;
&lt;li&gt;use Appian (or a Stored Proc) to retrieve the current value of &amp;#39;id&amp;#39;. If the date in the DB is the same as today&amp;#39;s date then add 1 to the value of &amp;#39;id&amp;#39; and write that back to the DB along with the current date&lt;/li&gt;
&lt;li&gt;if the value of the date in the column is different to today&amp;#39;s date simply re-set &amp;#39;id&amp;#39; to 1 and write it back along with the current date&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;(Use of a Stored Proc is more robust as it allows you to lock the current row and thus ensure concurrent requests to it do not result in the same value being retrieved/written)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generate Case Number</title><link>https://community.appian.com/thread/69735?ContentTypeID=1</link><pubDate>Fri, 04 Oct 2019 15:58:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1aaf2890-ca17-47cb-b441-c7a58ddc6741</guid><dc:creator>Robert Shankin</dc:creator><description>&lt;p&gt;Dawid -&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can there only be a maximum of 100 cases per day?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generate Case Number</title><link>https://community.appian.com/thread/69734?ContentTypeID=1</link><pubDate>Fri, 04 Oct 2019 15:49:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7d3cdfc5-fce5-43c0-8456-24976a48b997</guid><dc:creator>ChristineLHutchison</dc:creator><description>&lt;p&gt;Is this “number” stored in the DB? If so, another approach is to make a view to return a 1 or 0 or next number with the use of CASE statement to check if none in for today.&lt;/p&gt;
&lt;p&gt;Hope that gives you another approach &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generate Case Number</title><link>https://community.appian.com/thread/69722?ContentTypeID=1</link><pubDate>Fri, 04 Oct 2019 14:04:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:09f28854-0c2a-4ef9-835c-1141d724f16f</guid><dc:creator>Siddharth</dc:creator><description>&lt;p&gt;Hi Dawid - You can have a constant of type number(integer) that would function as the &amp;quot;id&amp;quot; of the case in your database. This constant would be set to 1 initially and would be incremented by 1 after a case is created. You would have to update this constant to 1 via a nightly process so that the &amp;quot;id&amp;quot; is reset every day.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>