<?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>Updatecdt function in expression rules</title><link>https://community.appian.com/discussions/f/rules/12091/updatecdt-function-in-expression-rules</link><description>Hi All , 
 Can u please tell me how to use updatecdt() function in expression rule . 
 Load( 
 Local!data:{ 
 {Id: 1, order:null}, 
 {Id:2, order:null}, 
 {Id:3, order:null} 
 }, 
 local!updateColumn: updatearray( 
 Local!Data.order, 
 {1,2,3}, 
 {1,2</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Updatecdt function in expression rules</title><link>https://community.appian.com/thread/53595?ContentTypeID=1</link><pubDate>Thu, 22 Mar 2018 16:30:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e3770524-ae5d-4968-8ed7-6dfe327c548b</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;In that case you simply need to generate a new array for the values needed in the &amp;quot;order&amp;quot; property; you can do this beforehand by whatever logic you need, then pass it into updateCdt().&amp;nbsp; It just needs to match the length of the local!data array.&lt;/p&gt;
&lt;p&gt;&lt;a href="/cfs-file/__key/communityserver-discussions-components-files/15/pastedimage1521736266528v1.png"&gt;&lt;img src="/resized-image/__size/390x244/__key/communityserver-discussions-components-files/15/pastedimage1521736266528v1.png" alt=" " /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updatecdt function in expression rules</title><link>https://community.appian.com/thread/53593?ContentTypeID=1</link><pubDate>Thu, 22 Mar 2018 16:08:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:02f3e32d-a63c-4f1d-ad83-dd5216fe429d</guid><dc:creator>bhargavip</dc:creator><description>There will be only one duplicate value in the id column I.e it will be 1 or 2 or anything only one duplicate item will be there&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updatecdt function in expression rules</title><link>https://community.appian.com/thread/53592?ContentTypeID=1</link><pubDate>Thu, 22 Mar 2018 16:05:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c5aa1960-9642-4bf3-ae52-bb0dc0892554</guid><dc:creator>bhargavip</dc:creator><description>Actually I will be updating only some part of the array like where ever id is repeating I need to update that order values to some data.&lt;br /&gt;
Local!Data:{&lt;br /&gt;
{Id:1,order:null},&lt;br /&gt;
{Id:2,order:null},&lt;br /&gt;
{Id:1,order:null}&lt;br /&gt;
}&lt;br /&gt;
So I need output array should be like bellow &lt;br /&gt;
{Id:1,order:1},&lt;br /&gt;
{Id:2,order:null},&lt;br /&gt;
{Id:1,order:2}&lt;br /&gt;
So to achieve this first I am finding out the id which is duplicate then I am updating that order column &lt;br /&gt;
Then apending to main array. &lt;br /&gt;
&lt;br /&gt;
Please tell me to achieve this as I am facing some issues here&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updatecdt function in expression rules</title><link>https://community.appian.com/thread/53582?ContentTypeID=1</link><pubDate>Thu, 22 Mar 2018 14:18:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:39081d3a-3044-4493-a562-3e8966f1145f</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Also if you don&amp;#39;t need the updateArray portion, you can use updateCdt directly if given the correct syntax:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  Local!data:{
    {Id: 1, order:null},
    {Id: 2, order:null},
    {Id: 3, order:null}
  },
  
  updatecdt(
    Local!Data,
    {
      order: {1, 2, 3}
    }
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;output:&lt;/p&gt;
&lt;p&gt;&lt;a href="/cfs-file/__key/communityserver-discussions-components-files/15/pastedimage1521728383333v1.png"&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/15/pastedimage1521728383333v1.png" alt=" " /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updatecdt function in expression rules</title><link>https://community.appian.com/thread/53581?ContentTypeID=1</link><pubDate>Thu, 22 Mar 2018 14:16:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8f480835-632c-4f8a-a644-1aef1881f6b2</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Here&amp;#39;s the output I get when using the code I posted before:&lt;/p&gt;
&lt;p&gt;&lt;a href="/cfs-file/__key/communityserver-discussions-components-files/15/pastedimage1521728185582v1.png"&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/15/pastedimage1521728185582v1.png" alt=" " /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re getting something different, can you post a screenshot?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updatecdt function in expression rules</title><link>https://community.appian.com/thread/53580?ContentTypeID=1</link><pubDate>Thu, 22 Mar 2018 14:12:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1db9108c-2a92-410c-b5d8-c11c7c2f1ea7</guid><dc:creator>bhargavip</dc:creator><description>I have tried the same which u have posted&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updatecdt function in expression rules</title><link>https://community.appian.com/thread/53573?ContentTypeID=1</link><pubDate>Thu, 22 Mar 2018 13:07:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:10094b49-d71c-4488-bfc6-939707ae80ac</guid><dc:creator>Mike Schmitt</dc:creator><description>Please paste the updated sample code you&amp;#39;re trying?&lt;br /&gt;
REgarding the &amp;quot;nested CDTs and lists&amp;quot; error, I was getting similar in my above example prior to wrapping the local!updatedColumn value in tointeger(); i believe the system was seeing it as &amp;quot;list of any type&amp;quot; otherwise which i suppose updateCdt has a hard time handling.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updatecdt function in expression rules</title><link>https://community.appian.com/thread/53571?ContentTypeID=1</link><pubDate>Thu, 22 Mar 2018 12:30:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ae2fd61c-6a84-4a44-ad8d-e17b2ab609e6</guid><dc:creator>bhargavip</dc:creator><description>Hi Mike I got the issue updatecdt function works only for cdts I was updating for dictionary that is the issue.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updatecdt function in expression rules</title><link>https://community.appian.com/thread/53566?ContentTypeID=1</link><pubDate>Thu, 22 Mar 2018 12:12:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cd9cdd4b-6048-421c-9447-fdb9c5e561ea</guid><dc:creator>bhargavip</dc:creator><description>Hi @mike I have used the same but still it&amp;#39;s throwing me error:&lt;br /&gt;
Nested cdts and lists currently not supported.&lt;br /&gt;
Please help me&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updatecdt function in expression rules</title><link>https://community.appian.com/thread/53550?ContentTypeID=1</link><pubDate>Wed, 21 Mar 2018 19:17:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:65880869-5b3e-445a-8651-e81c83af403f</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;The second parameter of updateCdt needs to be a set, containing an array of properties and new values (array in itself). &amp;nbsp;So if you&amp;#39;re only updating one of the properties of local!Data, it would be an array of 1.&amp;nbsp; Also, your updateColumn is setting one too many new column indices, it needs to only use the array {1,2,3} instead of {1,2,3,4}.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  Local!data:{
    {Id: 1, order:null},
    {Id: 2, order:null},
    {Id: 3, order:null}
  },

  local!updateColumn: tointeger(
    updatearray(
      Local!Data.order,
      {1,2,3},
      {1,2,3}
    )
  ),
  
  updatecdt(
    Local!Data,
    {
      order:{(local!updateColumn)}
    }
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Also note: the property name (&amp;quot;order&amp;quot;) used in updateCdt needs to match the case as found in the initial dictionary - if you use uppercase as in your example, it will insert a new property with the uppercase &amp;quot;O&amp;quot; instead of replacing what was already in the &amp;quot;order&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>