<?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>QueryEntity - Result Type</title><link>https://community.appian.com/discussions/f/data/10244/queryentity---result-type</link><description>Hi all, 
 We are in the process of converting some of our query rules to a!queryEntity() expression rules, since the latter is much faster in terms of execution time. 
 However, it looks like a!queryEntity returns the result of type &amp;quot;Any Type&amp;quot;, and not</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: QueryEntity - Result Type</title><link>https://community.appian.com/thread/45553?ContentTypeID=1</link><pubDate>Mon, 22 May 2017 13:48:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6dfa948e-70bb-4cd1-9f4e-a4463a45622d</guid><dc:creator>amans</dc:creator><description>Have your query entity in a load variable, and then cast it as shown in the example below;&lt;br /&gt;
&lt;br /&gt;
load(&lt;br /&gt;
  local!DataSubset: a!queryEntity(&lt;br /&gt;
    entity: cons!COM_ENTITY_ABC,&lt;br /&gt;
    query: a!query(&lt;br /&gt;
      logicalExpression: a!queryLogicalExpression(&lt;br /&gt;
        operator: &amp;quot;AND&amp;quot;,&lt;br /&gt;
        filters: {&lt;br /&gt;
          if(rule!COM_isNullOrEmpty(ri!Id),{},&lt;br /&gt;
          a!queryFilter(&lt;br /&gt;
            field: &amp;quot;Id&amp;quot;,&lt;br /&gt;
            operator: &amp;quot;in&amp;quot;,&lt;br /&gt;
            value: ri!Id&lt;br /&gt;
          ))&lt;br /&gt;
        }&lt;br /&gt;
      ),&lt;br /&gt;
      pagingInfo: a!pagingInfo(&lt;br /&gt;
        startIndex: 1,&lt;br /&gt;
        batchSize: - 1&lt;br /&gt;
      )&lt;br /&gt;
    )&lt;br /&gt;
  ),&lt;br /&gt;
  if(&lt;br /&gt;
    local!DataSubset.totalCount &amp;gt; 0,&lt;br /&gt;
    cast(&lt;br /&gt;
      typeof(&lt;br /&gt;
        {&lt;br /&gt;
          &amp;amp;#x27;type!CDTname&amp;amp;#x27;()&lt;br /&gt;
        }&lt;br /&gt;
      ),&lt;br /&gt;
      local!DataSubset.data&lt;br /&gt;
    ),&lt;br /&gt;
    {}&lt;br /&gt;
  )&lt;br /&gt;
)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: QueryEntity - Result Type</title><link>https://community.appian.com/thread/45237?ContentTypeID=1</link><pubDate>Thu, 04 May 2017 04:53:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8b5b9d35-149a-4a73-b3dc-bad9e96f5d6d</guid><dc:creator>Shashank</dc:creator><description>Hi , &lt;br /&gt;
&lt;br /&gt;
To add something to the solution above , in case of an array you can use cast(typeof({ri!expectedCDT}),&amp;lt;yourData&amp;gt;)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: QueryEntity - Result Type</title><link>https://community.appian.com/thread/45223?ContentTypeID=1</link><pubDate>Wed, 03 May 2017 17:46:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:edc9002d-c794-41ac-b5a3-458348a8804c</guid><dc:creator>Josh</dc:creator><description>I&amp;amp;#x27;m unaware of a way to cast the results via the specified data store entity, but you could accomplish this by passing in the expected cdt. Ex. cast(typeof(ri!expectedCDT), local!queryEntityResult.data)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>