<?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>need to update nested cdt column data</title><link>https://community.appian.com/discussions/f/general/39697/need-to-update-nested-cdt-column-data</link><description>Hi 
 i have a process variable called request_data which is cdt type and in that there was one column called casettnotes which is a cdt casenotes cdt has currently 4 rows of data in that there was a column casenote which i need to update which is 4th</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: need to update nested cdt column data</title><link>https://community.appian.com/thread/151431?ContentTypeID=1</link><pubDate>Wed, 10 Sep 2025 11:11:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b3a7ff9c-70f5-4cbf-8aff-3becc83ae16c</guid><dc:creator>Shubham Aware</dc:creator><description>&lt;p&gt;If you want to update 20 columns i would recommend below approach&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!request_data: a!map(
    requestId: 123,
    requestType: &amp;quot;Service Request&amp;quot;,
    casettnotes: {
      a!map(
        id: null,
        issuetype: &amp;quot;pending&amp;quot;,
        casenote: &amp;quot;First note&amp;quot;,
        status: &amp;quot;open&amp;quot;,
        priority: &amp;quot;low&amp;quot;,
        assignedTo: &amp;quot;user1&amp;quot;,
        department: &amp;quot;IT&amp;quot;,
        category: &amp;quot;Hardware&amp;quot;,
        subcategory: &amp;quot;Laptop&amp;quot;,
        createdDate: today() - 3,
        createdBy: &amp;quot;john.doe&amp;quot;,
        modifiedDate: null,
        modifiedBy: null,
        resolution: null,
        resolutionDate: null,
        escalationLevel: 0,
        reviewerNotes: null,
        approvalStatus: &amp;quot;pending&amp;quot;,
        attachmentId: null,
        ticketNumber: &amp;quot;TKT-001&amp;quot;,
        customerEmail: &amp;quot;customer1@test.com&amp;quot;,
        customerPhone: &amp;quot;123-456-7890&amp;quot;,
        location: &amp;quot;Building A&amp;quot;,
        urgencyReason: null
      ),
      a!map(
        id: null,
        issuetype: &amp;quot;approved&amp;quot;,
        casenote: &amp;quot;Second note&amp;quot;,
        status: &amp;quot;in_progress&amp;quot;,
        priority: &amp;quot;medium&amp;quot;,
        assignedTo: &amp;quot;user2&amp;quot;,
        department: &amp;quot;HR&amp;quot;,
        category: &amp;quot;Access&amp;quot;,
        subcategory: &amp;quot;Badge&amp;quot;,
        createdDate: today() - 2,
        createdBy: &amp;quot;jane.smith&amp;quot;,
        modifiedDate: today() - 1,
        modifiedBy: &amp;quot;admin&amp;quot;,
        resolution: null,
        resolutionDate: null,
        escalationLevel: 1,
        reviewerNotes: &amp;quot;Under review&amp;quot;,
        approvalStatus: &amp;quot;approved&amp;quot;,
        attachmentId: 12345,
        ticketNumber: &amp;quot;TKT-002&amp;quot;,
        customerEmail: &amp;quot;customer2@test.com&amp;quot;,
        customerPhone: &amp;quot;234-567-8901&amp;quot;,
        location: &amp;quot;Building B&amp;quot;,
        urgencyReason: &amp;quot;New employee&amp;quot;
      ),
      a!map(
        id: null,
        issuetype: &amp;quot;review&amp;quot;,
        casenote: &amp;quot;Third note&amp;quot;,
        status: &amp;quot;on_hold&amp;quot;,
        priority: &amp;quot;high&amp;quot;,
        assignedTo: &amp;quot;user3&amp;quot;,
        department: &amp;quot;Finance&amp;quot;,
        category: &amp;quot;Software&amp;quot;,
        subcategory: &amp;quot;License&amp;quot;,
        createdDate: today() - 1,
        createdBy: &amp;quot;bob.wilson&amp;quot;,
        modifiedDate: null,
        modifiedBy: null,
        resolution: null,
        resolutionDate: null,
        escalationLevel: 2,
        reviewerNotes: &amp;quot;Awaiting approval&amp;quot;,
        approvalStatus: &amp;quot;review&amp;quot;,
        attachmentId: 67890,
        ticketNumber: &amp;quot;TKT-003&amp;quot;,
        customerEmail: &amp;quot;customer3@test.com&amp;quot;,
        customerPhone: &amp;quot;345-678-9012&amp;quot;,
        location: &amp;quot;Building C&amp;quot;,
        urgencyReason: &amp;quot;Budget approval needed&amp;quot;
      ),
      a!map(
        id: null,
        issuetype: &amp;quot;failed&amp;quot;,
        casenote: &amp;quot;OLD NOTE - NEEDS UPDATE&amp;quot;,
        status: &amp;quot;open&amp;quot;,
        priority: &amp;quot;low&amp;quot;,
        assignedTo: &amp;quot;user4&amp;quot;,
        department: &amp;quot;Operations&amp;quot;,
        category: &amp;quot;Other&amp;quot;,
        subcategory: &amp;quot;General&amp;quot;,
        createdDate: today(),
        createdBy: &amp;quot;alice.jones&amp;quot;,
        modifiedDate: null,
        modifiedBy: null,
        resolution: null,
        resolutionDate: null,
        escalationLevel: 0,
        reviewerNotes: null,
        approvalStatus: &amp;quot;pending&amp;quot;,
        attachmentId: null,
        ticketNumber: &amp;quot;TKT-004&amp;quot;,
        customerEmail: &amp;quot;customer4@test.com&amp;quot;,
        customerPhone: &amp;quot;456-789-0123&amp;quot;,
        location: &amp;quot;Building D&amp;quot;,
        urgencyReason: null
      )
    }
  ),
  local!updates: a!map(
    casenote: &amp;quot;RESOLVED: Issue has been fixed and verified&amp;quot;,
    status: &amp;quot;resolved&amp;quot;,
    priority: &amp;quot;critical&amp;quot;,
    assignedTo: &amp;quot;senior.manager&amp;quot;,
    department: &amp;quot;IT-Security&amp;quot;,
    category: &amp;quot;Security&amp;quot;,
    subcategory: &amp;quot;Access Violation&amp;quot;,
    modifiedDate: now(),
    modifiedBy: loggedInUser(),
    resolution: &amp;quot;Access restored after security review&amp;quot;,
    resolutionDate: today(),
    escalationLevel: 3,
    reviewerNotes: &amp;quot;Escalated to management and resolved&amp;quot;,
    approvalStatus: &amp;quot;completed&amp;quot;,
    attachmentId: 99999,
    urgencyReason: &amp;quot;Critical security issue - immediate action taken&amp;quot;
  ),
  local!updatedData: a!update(
    local!request_data,
    &amp;quot;casettnotes&amp;quot;,
    a!forEach(
      items: local!request_data.casettnotes,
      expression: if(
        fv!index = 4,
        a!localVariables(
          local!mergedData: updateDictionary(fv!item, local!updates),
          local!mergedData
        ),
        fv!item
      )
    )
  ),
  local!updatedData
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: need to update nested cdt column data</title><link>https://community.appian.com/thread/151430?ContentTypeID=1</link><pubDate>Wed, 10 Sep 2025 11:09:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:71971cc8-f0d1-487a-bdc9-bdea7ff2f056</guid><dc:creator>Shubham Aware</dc:creator><description>&lt;p&gt;No!&amp;nbsp; a!update() only modifies the fields you specify and automatically preserves all other columns unchanged.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: need to update nested cdt column data</title><link>https://community.appian.com/thread/151429?ContentTypeID=1</link><pubDate>Wed, 10 Sep 2025 10:44:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bf66c02c-6886-45e6-87bb-3d348206a11c</guid><dc:creator>dharanik2600</dc:creator><description>&lt;p&gt;thank you so much for code&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;casetnotes cdt has many columns like more that 20 do i need map every column could you please confirm?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: need to update nested cdt column data</title><link>https://community.appian.com/thread/151427?ContentTypeID=1</link><pubDate>Wed, 10 Sep 2025 08:57:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9b1ee86b-1cfb-4ef8-bbf7-1a6a91871058</guid><dc:creator>Shubham Aware</dc:creator><description>&lt;p&gt;I tried to replicate your issue with map.&lt;br /&gt;Try it once for your CDT and let me know if that works for you.&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!request_data: a!map(
    requestId: 123,
    requestType: &amp;quot;Service Request&amp;quot;,
    casettnotes: {
      a!map(
        id: null, 
        issuetype: &amp;quot;pending&amp;quot;, 
        casenote: &amp;quot;First case note - pending review&amp;quot;,
        createdDate: today()-3
      ),
      a!map(
        id: null, 
        issuetype: &amp;quot;approved&amp;quot;, 
        casenote: &amp;quot;Second case note - approved by manager&amp;quot;,
        createdDate: today()-2
      ),
      a!map(
        id: null, 
        issuetype: &amp;quot;review&amp;quot;, 
        casenote: &amp;quot;Third case note - under review&amp;quot;,
        createdDate: today()-1
      ),
      a!map(
        id: null, 
        issuetype: &amp;quot;failed&amp;quot;, 
        casenote: &amp;quot;Fourth case note - THIS NEEDS UPDATE&amp;quot;,
        createdDate: today()
      )
    }
  ),

  local!newNoteValue: &amp;quot;UPDATED: Fourth row has been successfully modified&amp;quot;,

  local!updatedData: a!update(
      local!request_data,
      &amp;quot;casettnotes&amp;quot;,
      a!forEach(
        items: local!request_data.casettnotes,
        expression: if(
          /* Condition: Update 4th row OR where issuetype = &amp;quot;failed&amp;quot; */
          or(
            fv!index = 4,
            fv!item.issuetype = &amp;quot;failed&amp;quot;
          ),
          a!update(
            fv!item,
            &amp;quot;casenote&amp;quot;,
            local!newNoteValue
          ),
          fv!item
        )
      )
    ),
  
  local!updatedData
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: need to update nested cdt column data</title><link>https://community.appian.com/thread/151425?ContentTypeID=1</link><pubDate>Wed, 10 Sep 2025 08:36:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:385116ed-0235-493c-91e7-c4409f02e040</guid><dc:creator>Harsha Sharma</dc:creator><description>&lt;p&gt;It is very difficult to understand the structure this way. Can you try creating a map with how actually your cdt structure is and for which cdt which field you are facing challenge. Some example of what your input is and expected output is will be helpful too.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>