<?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>Compare Data Changes in CDT</title><link>https://community.appian.com/discussions/f/general/8568/compare-data-changes-in-cdt</link><description>HI , I am trying to capture the audit trail , for data changes in a CDT. Is there any OOTB function , which might be helpful Thanks OriginalPostID-239248</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Compare Data Changes in CDT</title><link>https://community.appian.com/thread/51119?ContentTypeID=1</link><pubDate>Tue, 26 Dec 2017 13:00:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:79fd8852-6a7b-4ba4-9ab8-f166f03829b4</guid><dc:creator>viveku3486</dc:creator><description>I think you can try difference() function, May be it will help you&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compare Data Changes in CDT</title><link>https://community.appian.com/thread/51089?ContentTypeID=1</link><pubDate>Fri, 22 Dec 2017 12:56:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b64a0df3-09dd-4604-98dd-f665c5102be4</guid><dc:creator>aswinb608</dc:creator><description>Consider creating audit history tables in db using triggers....doing it the appian way is complicated with lot of expression rule logic which can cause performance issues&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compare Data Changes in CDT</title><link>https://community.appian.com/thread/51038?ContentTypeID=1</link><pubDate>Thu, 21 Dec 2017 05:11:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:19c638e0-566c-40af-865e-aa113676c281</guid><dc:creator>anjup</dc:creator><description>Hi... I have similar requirement to fetch the CDT field names, I am getting the error below&lt;br /&gt;
&amp;quot;An error occurred while trying to parse the XML stream&amp;quot; while using &amp;quot;xpathsnippet&amp;quot;. Please help me on this.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compare Data Changes in CDT</title><link>https://community.appian.com/thread/37800?ContentTypeID=1</link><pubDate>Fri, 07 Oct 2016 13:50:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:779db650-2a4e-4165-8195-f66b75cd0b24</guid><dc:creator>Stefan Helzle</dc:creator><description>You are welcome :-)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compare Data Changes in CDT</title><link>https://community.appian.com/thread/37794?ContentTypeID=1</link><pubDate>Fri, 07 Oct 2016 13:34:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:595040cf-0b5a-414d-83db-0f9af15c176b</guid><dc:creator>Shashank</dc:creator><description>@stefanh , thanks a lot it was very helpful, the &amp;quot;xpathsnippet&amp;quot; would be of great use to me , never thought of xpathsnippet for getting the field names&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compare Data Changes in CDT</title><link>https://community.appian.com/thread/37786?ContentTypeID=1</link><pubDate>Fri, 07 Oct 2016 12:57:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:25f7ba5a-0c39-45d1-b8b1-8866dd48cf16</guid><dc:creator>Stefan Helzle</dc:creator><description>Did some small tests. It might not work for all cases, but can be a start:&lt;br /&gt;&lt;br /&gt;CdtDiff(cdt1, cdt2):&lt;br /&gt;=with(&lt;br /&gt;  local!fieldNames: apply(xpathsnippet(_, &amp;quot;name(*)&amp;quot;), xpathsnippet(toxml(ri!cdt1), &amp;quot;/*/*&amp;quot;)),&lt;br /&gt;  apply(rule!CdtDiffField(ri!cdt1, ri!cdt2, _), local!fieldNames)&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;CdtDiffField(cdt1, cdt2, fieldName):&lt;br /&gt;=with(&lt;br /&gt;  local!fieldOneType: runtimetypeof(index(ri!cdt1, ri!fieldName, null)),&lt;br /&gt;  local!fieldTwoType: runtimetypeof(index(ri!cdt2, ri!fieldName, null)),&lt;br /&gt;  local!fieldOneExits: tostring(index(ri!cdt1, ri!fieldName, &amp;quot;x_#&amp;quot;)) &amp;lt;&amp;gt; &amp;quot;x_#&amp;quot;,&lt;br /&gt;  local!fieldTwoExits: tostring(index(ri!cdt2, ri!fieldName, &amp;quot;x_#&amp;quot;)) &amp;lt;&amp;gt; &amp;quot;x_#&amp;quot;,&lt;br /&gt;  if(and(local!fieldOneExits, local!fieldTwoExits, local!fieldOneType = local!fieldTwoType),&lt;br /&gt;    if(local!fieldOneType &amp;lt; 1000,&lt;br /&gt;      {field: ri!fieldname, same: ri!cdt1[ri!fieldName] = ri!cdt2[ri!fieldName]},&lt;br /&gt;      {field: ri!fieldname, children: apply(rule!CdtDiff(_,_), merge(ri!cdt1[ri!fieldName], ri!cdt2[ri!fieldName]))}&lt;br /&gt;    ),&lt;br /&gt;    false&lt;br /&gt;  )&lt;br /&gt;)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compare Data Changes in CDT</title><link>https://community.appian.com/thread/37783?ContentTypeID=1</link><pubDate>Fri, 07 Oct 2016 11:52:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:98ccfc4c-891b-4977-983f-35af2b509018</guid><dc:creator>Stefan Helzle</dc:creator><description>Using some ideas from &lt;a href="https://forum.appian.com/suite/tempo/entry/e-238884"&gt;forum.appian.com/.../e-238884&lt;/a&gt; you should be able to implement a recursive expression to handle nested CDTs. First expression gets all field names. Then you create an expression that is applied to all fields in the CDT. It checks if the datatype is a multiple and/or a CDT. If yes, it calls the first expression on the sub structure.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compare Data Changes in CDT</title><link>https://community.appian.com/thread/37776?ContentTypeID=1</link><pubDate>Fri, 07 Oct 2016 10:36:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d1f3e918-9753-469b-a80a-b8c439304c09</guid><dc:creator>Shashank</dc:creator><description>@Bolluru Mahesh Sachin Anand , thanks for the shared component , it was helpful , but i am still trying to figure out a way to handle nested CDTs&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compare Data Changes in CDT</title><link>https://community.appian.com/thread/37774?ContentTypeID=1</link><pubDate>Fri, 07 Oct 2016 10:35:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:afd8fe85-046d-4ebe-bdd9-a256b2d6b560</guid><dc:creator>Shashank</dc:creator><description>@sikhivahans , it is temporary only , i am not considering persisting the data for now  as @chetany mentioned , the plugin is not able to handle nested cdts , I am still trying to figure out a way for that , any suggestion on that part also would be helpful , according to my requirement , the rule should be a generic one , which can handle any type of CDT and get the differences in data ( latest and the very previous one only)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compare Data Changes in CDT</title><link>https://community.appian.com/thread/37771?ContentTypeID=1</link><pubDate>Fri, 07 Oct 2016 10:20:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b9234864-1351-435e-becf-ac043bd5325b</guid><dc:creator>sikhivahans</dc:creator><description>@shashankb Is it temporary or are you trying to persist it to the database? If it&amp;#39;s later, did you consider delegating it to the database?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compare Data Changes in CDT</title><link>https://community.appian.com/thread/37770?ContentTypeID=1</link><pubDate>Fri, 07 Oct 2016 10:06:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:00621dde-3a59-462c-ae85-b86873bbf506</guid><dc:creator>chetany</dc:creator><description>It also will not work if the CDT is nested&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compare Data Changes in CDT</title><link>https://community.appian.com/thread/37769?ContentTypeID=1</link><pubDate>Fri, 07 Oct 2016 10:01:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7dd6104a-66bf-46d8-b89b-360b4b514759</guid><dc:creator>jagadeesh</dc:creator><description>Yes above one helped you to get changed attributes data from your CDTs. but your CDTs should contains primitive data types and shouldn&amp;#39;t contain array variables&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compare Data Changes in CDT</title><link>https://community.appian.com/thread/37768?ContentTypeID=1</link><pubDate>Fri, 07 Oct 2016 09:58:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f6355cd0-b18e-410c-8567-3c10bb42ff15</guid><dc:creator>Sachin</dc:creator><description>@Shashank please find the below shared component &lt;a href="https://forum.appian.com/suite/tempo/records/item/lMBCLGOdlMUpdGVqW3dQaIKmclBmvvNEj8vu_cjb7T-5YiPr4Fu8ly5Yj1s09uenE4RYzA8zKyx7eiUh-6mLnOFWZ2Kw3DS9B6D9fYp5XMFVd8xmQ/view/summary"&gt;forum.appian.com/.../summary&lt;/a&gt; &lt;br /&gt;hope this is helpful&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>