<?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>Query entity with multiple logical expressions</title><link>https://community.appian.com/discussions/f/general/18390/query-entity-with-multiple-logical-expressions</link><description>Is it possible to have a query entity with multiple logical expressions? i.e. have a query entity that has a logical expression that &amp;#39;AND&amp;#39;s a set of filters and another logical expression that &amp;#39;OR&amp;#39;s a set of filters and &amp;#39;AND&amp;#39;s those two logical expressions</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Query entity with multiple logical expressions</title><link>https://community.appian.com/thread/72417?ContentTypeID=1</link><pubDate>Mon, 02 Mar 2020 13:48:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4f75116c-1ebf-4c2e-8236-cc8085d1c963</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;To perhaps put it more simply, &lt;em&gt;a!queryLogicalExpression()&lt;/em&gt; has the &lt;em&gt;logicalExpressions:&lt;/em&gt; parameter specifically for this reason.&amp;nbsp; So you can make basically any combination of nested entries as needed.&amp;nbsp; If your top logical expression uses an &amp;quot;AND&amp;quot; operator, then it will return results that match all entries in the &amp;quot;filters&amp;quot; parameter as well as within the &amp;quot;logicalExpressions&amp;quot; parameter - so here you could potentially have a nested logical expression that uses the &amp;quot;OR&amp;quot; operator.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Query entity with multiple logical expressions</title><link>https://community.appian.com/thread/72404?ContentTypeID=1</link><pubDate>Sat, 29 Feb 2020 17:43:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:518118d3-6114-48b0-a008-c6bb6150bb7e</guid><dc:creator>payal31</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It is possible. In this case, it should satisfy both logical expressions. All filters should be true in AND logical expression and any one of the filters should be true in OR logical expression.&lt;/p&gt;
&lt;p&gt;Please have a look in the code:&lt;/p&gt;
&lt;p&gt;a!queryEntity(&lt;br /&gt; entity: cons!PG_ENTITY_EMPLOYEE_DETAILS,&lt;br /&gt; query: a!query(&lt;br /&gt; logicalExpression: a!queryLogicalExpression(&lt;br /&gt; operator: &amp;quot;AND&amp;quot;,&lt;br /&gt; logicalExpressions: {&lt;br /&gt; 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;RequestId&amp;quot;,&lt;br /&gt; operator: &amp;quot;=&amp;quot;,&lt;br /&gt; value: ri!requestId&lt;br /&gt; )&lt;br /&gt; }&lt;br /&gt; ),&lt;br /&gt; a!queryLogicalExpression(&lt;br /&gt; operator: &amp;quot;OR&amp;quot;,&lt;br /&gt; filters: {&lt;br /&gt; a!queryFilter(&lt;br /&gt; field: &amp;quot;Status&amp;quot;,&lt;br /&gt; operator: &amp;quot;=&amp;quot;,&lt;br /&gt; value: ri!status&lt;br /&gt; ),&lt;br /&gt; a!queryFilter(&lt;br /&gt; field: &amp;quot;IsActive&amp;quot;,&lt;br /&gt; operator: &amp;quot;=&amp;quot;,&lt;br /&gt; value: ri!isActive&lt;br /&gt; )&lt;br /&gt; }&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;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>