<?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>how to check if field does not exist in old CDT</title><link>https://community.appian.com/discussions/f/general/12004/how-to-check-if-field-does-not-exist-in-old-cdt</link><description>Let&amp;#39;s say I have a CDT with two mandatory fields, A and B, used in forms in a long process. 
 I then add another mandatory field C in the CDT and the interface. For processes that started after the field was added, there will be no problem. 
 For in-flight</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: how to check if field does not exist in old CDT</title><link>https://community.appian.com/thread/53158?ContentTypeID=1</link><pubDate>Tue, 06 Mar 2018 20:39:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fb273ea7-dfdd-41de-a7c4-137ed4027fbe</guid><dc:creator>benjamins</dc:creator><description>&lt;p&gt;I do something like&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;local!doesFieldExist: index(ri!myCDT, &amp;quot;field&amp;quot;, &amp;quot;oldVersion&amp;quot;) = &amp;quot;oldVersion&amp;quot;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Then in my SAIL code perform checks to see if doesFieldExist&amp;nbsp;= true. If its true, dont display the section which allows the user to be able to save the form and move on.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to check if field does not exist in old CDT</title><link>https://community.appian.com/thread/53151?ContentTypeID=1</link><pubDate>Tue, 06 Mar 2018 12:24:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a476ae13-8464-4cb8-b55e-0e67e2e69d1f</guid><dc:creator>normanc</dc:creator><description>&lt;p&gt;Perhaps try converting the CDT to text using toxml() and check if the text contains an element for the new field.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to check if field does not exist in old CDT</title><link>https://community.appian.com/thread/53123?ContentTypeID=1</link><pubDate>Mon, 05 Mar 2018 20:24:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cdae4054-640e-49de-845a-bf296d262f01</guid><dc:creator>Chris</dc:creator><description>No problem.  Note since your process instance and CDT are essentially hard coded together based on their configuration at start time, you will need some similar approach here as there are no OOTB functions to cleanly determine field existence within a CDT.  Utilizing &amp;quot;if(version &amp;gt; 1 ..&amp;quot; will provide scalability for future versions without any additional changes to these fields, once configured.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to check if field does not exist in old CDT</title><link>https://community.appian.com/thread/53122?ContentTypeID=1</link><pubDate>Mon, 05 Mar 2018 20:04:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3778d20f-59ca-4e66-a7ff-0ecebdfe38b9</guid><dc:creator>tommyc0001</dc:creator><description>Thanks for the suggestion. This seems like a possible solution but I don&amp;#39;t feel comfortable hardcoding behaviors based on versions as we add fields around once a month.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to check if field does not exist in old CDT</title><link>https://community.appian.com/thread/53121?ContentTypeID=1</link><pubDate>Mon, 05 Mar 2018 19:59:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:085f2242-dff8-409a-ada3-fb29a59a05ad</guid><dc:creator>tommyc0001</dc:creator><description>Hi Mike,&lt;br /&gt;
&lt;br /&gt;
Actually that&amp;#39;s what we are currently doing at the moment. Our processes are sometimes over a year long and many new fields have been introduced due to the agile approach, we can not maintain an ever growing list of ri!hasFieldXYZ inputs in our interface. &lt;br /&gt;
&lt;br /&gt;
We have also tried to initialize a value for the new fields in the process and do a check to show the field when the field isn&amp;#39;t prepopulated. For Legal reason we can&amp;#39;t prepopulate some fields though. &lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
Tommy&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to check if field does not exist in old CDT</title><link>https://community.appian.com/thread/53120?ContentTypeID=1</link><pubDate>Mon, 05 Mar 2018 19:55:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ac355a9b-67fc-4408-9bef-382e7594cd71</guid><dc:creator>Chris</dc:creator><description>Expanding on Mike&amp;#39;s suggestion, what I usually do here is add a field to the CDT during the next update, integer value, named &amp;quot;version&amp;quot;.  Set this in the CDT at process initiation, I use a pv!version variable, set at 2 at this time and save into your CDT prior to any Write to DS (usually script task at the very beginning).  When utilizing the pv! you can increment this value in the model any time you will be adding CDT fields or making changes that affect how your forms or sub processes will process going forward.&lt;br /&gt;
&lt;br /&gt;
On your forms, utilize a local version variable with the definition:&lt;br /&gt;
&lt;br /&gt;
local!version:  index(ri!CDT,&amp;quot;version&amp;quot;,1)&lt;br /&gt;
&lt;br /&gt;
This will default to 1 if the version field is not present (legacy instances), or reflect 2 for newer instances.  From there, you can implement logic in the form processing based on which version of your CDT is present, without manipulating any running instances, such as, if(local!version&amp;gt;1, show new fields, do nothing).  This allows scalability on your future versioning as well.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to check if field does not exist in old CDT</title><link>https://community.appian.com/thread/53118?ContentTypeID=1</link><pubDate>Mon, 05 Mar 2018 19:11:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:34cb7e98-93eb-48ec-9822-31669a0c728d</guid><dc:creator>Mike Schmitt</dc:creator><description>The way I&amp;#39;ve handled this before is to pass in a new parameter to the form, i.e. ri!isNewVersion (or ri!hasFieldXYZ), where the process model is updated to pass a value of true() into the form, so that you can use in-form logic to tell whether you&amp;#39;re in a new instance or not.  The nomenclature is completely up to you but hopefully you get the picture.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to check if field does not exist in old CDT</title><link>https://community.appian.com/thread/53116?ContentTypeID=1</link><pubDate>Mon, 05 Mar 2018 18:45:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:61ce4ab3-4c60-4b77-9892-f35e14148ebf</guid><dc:creator>tommyc0001</dc:creator><description>I&amp;#39;ve tried that but the problem is that I&amp;#39;ll always be updating the CDT. I do not want to hard code the different types of CDT there is for each new field.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to check if field does not exist in old CDT</title><link>https://community.appian.com/thread/53115?ContentTypeID=1</link><pubDate>Mon, 05 Mar 2018 18:40:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e5885ae8-372c-43d2-855c-78aa82f0af6c</guid><dc:creator>bryant.st39</dc:creator><description>You could do a typeof() to return the data type for the variable and compare to a refernce, if they are equal then require C, else hide it.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>