<?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 to fetch the data of query entity in batches?</title><link>https://community.appian.com/discussions/f/user-interface/21880/how-to-fetch-the-data-of-query-entity-in-batches</link><description>Interface Definition: Expression evaluation error [evaluation ID = c9564:63ac5] : An error occurred while executing a save: Expression evaluation error in rule &amp;#39;TID_documentsquery&amp;#39; at function a!queryEntity_18r3 [line 2]: An error occurred while retrieving</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: how to fetch the data of query entity in batches?</title><link>https://community.appian.com/thread/85763?ContentTypeID=1</link><pubDate>Wed, 15 Sep 2021 07:04:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:da5e5eb7-37ef-4483-af2c-29f3c4ece71d</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Again, what is the purpose of fetching ALL data into memory?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to fetch the data of query entity in batches?</title><link>https://community.appian.com/thread/85758?ContentTypeID=1</link><pubDate>Wed, 15 Sep 2021 06:21:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b719a8db-4fc5-44e3-9435-f24c4c37402a</guid><dc:creator>Klaus34</dc:creator><description>&lt;p&gt;i have provided the batch size 5405&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to fetch the data of query entity in batches?</title><link>https://community.appian.com/thread/85757?ContentTypeID=1</link><pubDate>Wed, 15 Sep 2021 06:20:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8ecb2778-84a7-4365-bb61-e5ea5a11ee7a</guid><dc:creator>Klaus34</dc:creator><description>&lt;p&gt;Yea i increased it and it works but then it doesn&amp;#39;t fetch the&amp;nbsp; complete count of data&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to fetch the data of query entity in batches?</title><link>https://community.appian.com/thread/85755?ContentTypeID=1</link><pubDate>Wed, 15 Sep 2021 05:57:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2ee1827f-6d3e-4f6c-ad7e-bba4269913dd</guid><dc:creator>Malathi</dc:creator><description>&lt;p&gt;Seems you are fetching whole data by giving -1&amp;nbsp;batch size(though you have few columns). Can you try increasing the batch size gradually to find the threshold point?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to fetch the data of query entity in batches?</title><link>https://community.appian.com/thread/85754?ContentTypeID=1</link><pubDate>Wed, 15 Sep 2021 05:41:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:148eb4d0-c49d-4ac7-9d67-eb23e6215eec</guid><dc:creator>Klaus34</dc:creator><description>&lt;p&gt;a!queryEntity_18r3(&lt;br /&gt; entity: cons!TEST_ENTITY_CONTENT_VW,&lt;br /&gt; query: a!query(&lt;br /&gt; selection:a!querySelection(&lt;br /&gt; columns: {&lt;br /&gt; a!queryColumn(&lt;br /&gt; field: &amp;quot;contentId&amp;quot;&lt;br /&gt; ),&lt;br /&gt; a!queryColumn(&lt;br /&gt; field:&amp;quot;contentAreaId&amp;quot;&lt;br /&gt; ),&lt;br /&gt; a!queryColumn(&lt;br /&gt; field:&amp;quot;categoryId&amp;quot;&lt;br /&gt; ),&lt;br /&gt; a!queryColumn(&lt;br /&gt; field:&amp;quot;topicId&amp;quot;&lt;br /&gt; ),&lt;br /&gt; a!queryColumn(&lt;br /&gt; field:&amp;quot;UnitId&amp;quot;&lt;br /&gt; ),&lt;br /&gt; &lt;br /&gt; a!queryColumn(&lt;br /&gt; field:&amp;quot;Owner&amp;quot;&lt;br /&gt; ),&lt;br /&gt; a!queryColumn(&lt;br /&gt; field:&amp;quot;docName&amp;quot;&lt;br /&gt; ),&lt;br /&gt; &lt;br /&gt; a!queryColumn(&lt;br /&gt; field:&amp;quot;createdDt&amp;quot;&lt;br /&gt; ),&lt;br /&gt; a!queryColumn(&lt;br /&gt; field:&amp;quot;docDescription&amp;quot;&lt;br /&gt; ),&lt;br /&gt; a!queryColumn(&lt;br /&gt; field:&amp;quot;docLink&amp;quot;&lt;br /&gt; )&lt;br /&gt; }&lt;br /&gt; )&lt;br /&gt; &lt;br /&gt; ,&lt;br /&gt; logicalExpression: a!queryLogicalExpression(&lt;br /&gt; operator: &amp;quot;AND&amp;quot;,&lt;br /&gt; filters: {&lt;br /&gt; a!queryFilter(&lt;br /&gt; field: &amp;quot;contentId&amp;quot;,&lt;br /&gt; operator: &amp;quot;not null&amp;quot;&lt;br /&gt; ),&lt;br /&gt; if(&lt;br /&gt; or(isnull(ri!contentAreaIds), rule!APN_isEmpty(ri!contentAreaIds)),&lt;br /&gt; {},&lt;br /&gt; a!queryFilter(&lt;br /&gt; field: &amp;quot;contentAreaId&amp;quot;,&lt;br /&gt; operator: &amp;quot;in&amp;quot;,&lt;br /&gt; value: ri!contentAreaIds&lt;br /&gt; )&lt;br /&gt; ),&lt;br /&gt; if(&lt;br /&gt; or(isnull(ri!categoryIds), rule!APN_isEmpty(ri!categoryIds)),&lt;br /&gt; {},&lt;br /&gt; a!queryFilter(&lt;br /&gt; field: &amp;quot;categoryId&amp;quot;,&lt;br /&gt; operator: &amp;quot;in&amp;quot;,&lt;br /&gt; value: ri!categoryIds&lt;br /&gt; )&lt;br /&gt; ),&lt;br /&gt; if(&lt;br /&gt; or(isnull(ri!topicIds), rule!APN_isEmpty(ri!topicIds)),&lt;br /&gt; {},&lt;br /&gt; a!queryFilter(&lt;br /&gt; field: &amp;quot;topicId&amp;quot;,&lt;br /&gt; operator: &amp;quot;in&amp;quot;,&lt;br /&gt; value: ri!topicIds&lt;br /&gt; )&lt;br /&gt; ),&lt;br /&gt; if(&lt;br /&gt; rule!APN_isBlank(&lt;br /&gt; ri!buId&lt;br /&gt; ),&lt;br /&gt; {},&lt;br /&gt; a!queryFilter(&lt;br /&gt; field: &amp;quot;UnitId&amp;quot;,&lt;br /&gt; operator: &amp;quot;=&amp;quot;,&lt;br /&gt; value: ri!buId&lt;br /&gt; )&lt;br /&gt; ),&lt;br /&gt; if(&lt;br /&gt; rule!APN_isBlank(&lt;br /&gt; ri!Owner&lt;br /&gt; ),&lt;br /&gt; {},&lt;br /&gt; a!queryFilter(&lt;br /&gt; field: &amp;quot;Owner&amp;quot;,&lt;br /&gt; operator: &amp;quot;=&amp;quot;,&lt;br /&gt; value: ri!Owner&lt;br /&gt; )&lt;br /&gt; ),&lt;br /&gt; if(&lt;br /&gt; rule!APN_isBlank(&lt;br /&gt; ri!title&lt;br /&gt; ),&lt;br /&gt; {},&lt;br /&gt; a!queryFilter(&lt;br /&gt; field: &amp;quot;docName&amp;quot;,&lt;br /&gt; operator: &amp;quot;includes&amp;quot;,&lt;br /&gt; value: ri!title&lt;br /&gt; )&lt;br /&gt; ),&lt;br /&gt; if(&lt;br /&gt; or(rule!APN_isBlank(ri!startDate), rule!APN_isBlank(ri!endDate)),&lt;br /&gt; {},&lt;br /&gt; {&lt;br /&gt; a!queryFilter(&lt;br /&gt; field: &amp;quot;createdDt&amp;quot;,&lt;br /&gt; operator: &amp;quot;&amp;gt;=&amp;quot;,&lt;br /&gt; value: todatetime(ri!startDate)&lt;br /&gt; ),&lt;br /&gt; a!queryFilter(&lt;br /&gt; field: &amp;quot;createdDt&amp;quot;,&lt;br /&gt; operator: &amp;quot;&amp;lt;=&amp;quot;,&lt;br /&gt; value: todatetime(ri!endDate)&lt;br /&gt; )&lt;br /&gt; }&lt;br /&gt; )&lt;br /&gt; }&lt;br /&gt; ),&lt;br /&gt; pagingInfo: a!pagingInfo(startIndex:1, batchSize:-1)&lt;br /&gt; ) &lt;br /&gt; ),&lt;br /&gt;&lt;br /&gt;i have applied the selection also but still the issue persists.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to fetch the data of query entity in batches?</title><link>https://community.appian.com/thread/85739?ContentTypeID=1</link><pubDate>Tue, 14 Sep 2021 12:57:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1aa712a3-e663-47de-bf35-01117da7aec6</guid><dc:creator>Klaus34</dc:creator><description>&lt;p&gt;can u please share the code for reference.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to fetch the data of query entity in batches?</title><link>https://community.appian.com/thread/85738?ContentTypeID=1</link><pubDate>Tue, 14 Sep 2021 12:55:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d92ccec5-bbb9-4dae-aa52-57695d86fd39</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;For what purpose?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to fetch the data of query entity in batches?</title><link>https://community.appian.com/thread/85737?ContentTypeID=1</link><pubDate>Tue, 14 Sep 2021 12:50:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:740ed5e4-6c73-47fc-98c0-e1142957ff83</guid><dc:creator>vimalkumars</dc:creator><description>&lt;p&gt;It is not recommended to query more than 1MB of data to avoid memory issues. If you still need it, you can query them in batches. Like if there are 50k records, query them 5 times with a 10K batch size.&lt;/p&gt;
&lt;p&gt;Also, if you can share your use-case, community members can share some best practices around it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to fetch the data of query entity in batches?</title><link>https://community.appian.com/thread/85735?ContentTypeID=1</link><pubDate>Tue, 14 Sep 2021 12:47:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:24141631-d52d-4f95-84b9-b70703bcfabb</guid><dc:creator>Klaus34</dc:creator><description>&lt;p&gt;Actually i need all the data to be fetched.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to fetch the data of query entity in batches?</title><link>https://community.appian.com/thread/85734?ContentTypeID=1</link><pubDate>Tue, 14 Sep 2021 12:42:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:dfa8c29d-6f4c-42e2-aa10-b9dbb0563d30</guid><dc:creator>vimalkumars</dc:creator><description>&lt;p&gt;Your query call has reached the memory threshold limit ~ 1MB.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/21.3/Post-Install_Configurations.html#query-limits"&gt;docs.appian.com/.../Post-Install_Configurations.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/13/pastedimage1631623321765v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;This usually happens when you try to call a query entity with batch size set as -1 and you are trying to pull more records from the database. Check if you can reduce your output size by applying filter or batch-size&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>