<?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 do you go about loading data from a CDT to display in an interface</title><link>https://community.appian.com/discussions/f/general/14908/how-do-you-go-about-loading-data-from-a-cdt-to-display-in-an-interface</link><description>Hi all, 
 Absolute newbie in appian here. I have been tasked with developing a form that allows me to choose cases and tasks and transfer ownership of them to another user. 
 I have created a simple process model, with just a start and end node, and set</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How do you go about loading data from a CDT to display in an interface</title><link>https://community.appian.com/thread/66727?ContentTypeID=1</link><pubDate>Mon, 20 May 2019 15:45:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1dca37dc-7e38-42b7-a1d2-433b6dfa2f1a</guid><dc:creator>Krishna Chaitanya Mallavarapu</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  local!taskGridSelection: a!gridSelection(
    selected: {},
    pagingInfo: a!pagingInfo(
      startIndex: 1,
      batchSize: 10
    )
  ),
  local!caseGridSelection: a!gridSelection(
    selected: {},
    pagingInfo: a!pagingInfo(
      startIndex: 1,
      batchSize: 10
    )
  ),
  with(
    local!dbTasks: a!queryEntity(
      entity: cons!iMY_TASKS_DS,
      query: a!query(
        pagingInfo: local!taskGridSelection.pagingInfo
      ),
      fetchTotalCount: true
    ),
    local!dbCases: a!queryEntity(
      entity: cons!iMY_CASE_DETAILS_DS,
      query: a!query(
        pagingInfo: local!caseGridSelection.pagingInfo
      )
    ),
    a!sectionLayout(
      label: &amp;quot;Section&amp;quot;,
      contents: {
        a!gridField(
          label: &amp;quot;&amp;quot;,
          totalCount: local!dbTasks.totalCount,
          columns: {
            a!gridTextColumn(
              label: &amp;quot;Task ID&amp;quot;,
              field: &amp;quot;taskId&amp;quot;,
              data: index(
                local!dbTasks.data,
                &amp;quot;taskId&amp;quot;,
                {}
              )
            ),
            a!gridTextColumn(
              label: &amp;quot;Task Description&amp;quot;,
              field: &amp;quot;taskDescription&amp;quot;,
              data: index(
                local!dbTasks.data,
                &amp;quot;taskDescription&amp;quot;,
                {}
              )
            )
          },
          identifiers: local!dbTasks.identifiers,
          value: local!taskGridSelection,
          saveInto: {
            local!taskGridSelection
          },
          rowHeader: 1,
          selection: true,
          shadeAlternateRows: false
        ),
        a!gridField(
          label: &amp;quot;&amp;quot;,
          totalCount: local!dbCases.totalCount,
          columns: {
            a!gridTextColumn(
              label: &amp;quot;Case Number&amp;quot;,
              field: &amp;quot;caseNumber&amp;quot;,
              data: index(
                local!dbCases.data,
                &amp;quot;caseNumber&amp;quot;,
                {}
              )
            ),
            a!gridTextColumn(
              label: &amp;quot;Case Description&amp;quot;,
              field: &amp;quot;caseDescription&amp;quot;,
              data: index(
                local!dbCases.data,
                &amp;quot;caseDescription&amp;quot;,
                {}
              )
            )
          },
          identifiers: local!dbCases.identifiers,
          value: local!caseGridSelection,
          saveInto: {
            local!caseGridSelection
          },
          rowHeader: 1,
          selection: true
        )
      }
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do you go about loading data from a CDT to display in an interface</title><link>https://community.appian.com/thread/66710?ContentTypeID=1</link><pubDate>Mon, 20 May 2019 08:27:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:495729b8-e9a8-4e1a-b5a1-cad032c411a8</guid><dc:creator>davidb545</dc:creator><description>&lt;p&gt;thanks heaps for this - I&amp;#39;m looking at your suggestions at the moment.&amp;nbsp; will let you know when I&amp;#39;ve got something that compiles after the changes... :-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do you go about loading data from a CDT to display in an interface</title><link>https://community.appian.com/thread/66709?ContentTypeID=1</link><pubDate>Mon, 20 May 2019 08:08:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:01bb51af-1a7b-43cc-9d1d-da03c80d2e9c</guid><dc:creator>Harsha Sharma</dc:creator><description>&lt;p&gt;Below is a list of recommendations/changes you need to incorporate so that code can function properly.&lt;/p&gt;
&lt;p&gt;1. Create two different local variables for paging info, to be used by task and cases grid exclusively.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2. Query the database inside a with(). In other words, task and cases datasubset should be populated inside a with() block so that they can be reevaluated.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;load(
local!taskPaging:a!pagingInfo(1,10),
local!casePaging:a!pagingInfo(1,10),
with(
/*taskPaging for Task data subset*/
local!taskDatasubset:a!queryEntity(entity:{},pagingInfo:local!taskPaging),
/*CasePaging for Case Data subset*/
local!caseDatasubset:a!queryEntity(entity:{},pagingInfo:local!casePaging),
/*Sample Grid Code*/
a!gridField(
label:&amp;quot;Tasks&amp;quot;,
columns:{
a!gridTextColumns(
data:index(local!taskDatasubset.data,&amp;quot;taskName&amp;quot;,{}))},
saveInto:local!taskPaging,
value:local!taskPaging)
))&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;3.The syntax for total count is incorrect, It should be like&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;if(
rule!APN_isEmpty(
index(local!dbTasks,&amp;quot;data&amp;quot;,&amp;quot;&amp;quot;)
),
0,
index(
local!dbTasks,
&amp;quot;totalCount&amp;quot;,
0
))&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;totalCount is an attribute of datasubset so &amp;quot;data.totalCount&amp;quot; is an incorrect expression. Though &lt;strong&gt;local!dbTasks.totalCount&lt;/strong&gt; is correct.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do you go about loading data from a CDT to display in an interface</title><link>https://community.appian.com/thread/66708?ContentTypeID=1</link><pubDate>Mon, 20 May 2019 07:56:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a7da3c7c-a3bb-4e8e-b40e-fca179962425</guid><dc:creator>Harsha Sharma</dc:creator><description>&lt;p&gt;Hi David!&lt;/p&gt;
&lt;p&gt;The data is not coming in the grid because you are using the code as&amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;strong&gt;index(&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;local!dbTasks,&amp;quot;caseNumber&amp;quot;,{}).&amp;nbsp;&lt;/strong&gt;Here you need to change the syntax as -&lt;pre class="ui-code" data-mode="text"&gt;index(
local!dbTasks.data,
&amp;quot;caseNumber&amp;quot;,
{}
)&lt;/pre&gt;. Note the &amp;#39;data&amp;#39; part contains the data inside a datasubset.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>