<?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>Expression Rule</title><link>https://community.appian.com/discussions/f/rules/21857/expression-rule</link><description>Hi All , How to create a expression Rule where I want to check single or multiple mobile number is present or not in a DB . 
 Ex 1234,4567 present in a data base . If these two are there then return true else false</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Expression Rule</title><link>https://community.appian.com/thread/85670?ContentTypeID=1</link><pubDate>Fri, 10 Sep 2021 19:13:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:76d5ab37-bc46-4afc-b8ad-6fe900ada27a</guid><dc:creator>vimalkumars</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Hope the below code helps&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!dataSet: a!queryEntity(
    entity: &amp;quot;&amp;lt; DSE_Constant &amp;gt;&amp;quot;,
    query: a!query(
      logicalExpression: a!queryLogicalExpression(
        operator: &amp;quot;AND&amp;quot;,
        filters: {
          a!queryFilter(
            field: &amp;quot;rollnumber&amp;quot;,
            operator: &amp;quot;in&amp;quot;,
            value: { &amp;quot;AB000&amp;quot;, &amp;quot;AB0001&amp;quot; }
          )
        },
        ignoreFiltersWithEmptyValues: true
      ),
      pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 50)
    ),
    fetchTotalCount: true
  ),
  if(
    local!dataSet.totalCount = length({ &amp;quot;AB000&amp;quot;, &amp;quot;AB0001&amp;quot; }),
    true(),
    false()
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Expression Rule</title><link>https://community.appian.com/thread/85668?ContentTypeID=1</link><pubDate>Fri, 10 Sep 2021 18:27:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8482b191-5c18-4d8c-90ab-243cbc0576f8</guid><dc:creator>saurabh sharma</dc:creator><description>&lt;p&gt;Hi Selvakumar ,  Is this code test both values in an array one by one . If one value is present in an table and other is not there . What will happen this case &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Expression Rule</title><link>https://community.appian.com/thread/85662?ContentTypeID=1</link><pubDate>Fri, 10 Sep 2021 10:04:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:eaf44440-17ac-4bcc-be36-0882304219e2</guid><dc:creator>Selvakumar Kumarasamy</dc:creator><description>&lt;p&gt;The code has no issues, but you need to add a null check like below to achieve your requirement:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;if(
  isnull(
    a!queryEntity(
      entity: &amp;lt; DSE_Constant &amp;gt; ,
      query: a!query(
        logicalExpression: a!queryLogicalExpression(
          operator: &amp;quot;AND&amp;quot;,
          filters: {
            a!queryFilter(
              field: &amp;quot;siteid&amp;quot;,
              operator: &amp;quot;in&amp;quot;,
              value: { &amp;quot;AB000&amp;quot;, &amp;quot;AB0001&amp;quot; }
            )
          },
          ignoreFiltersWithEmptyValues: true
        ),
        pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 50)
      ),
      fetchTotalCount: false
    ).data
  ),
  &amp;quot;Not Present&amp;quot;,
  &amp;quot;Present&amp;quot;
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Expression Rule</title><link>https://community.appian.com/thread/85661?ContentTypeID=1</link><pubDate>Fri, 10 Sep 2021 09:58:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ff24b076-02ed-4150-aeb8-5bf1d576d2a1</guid><dc:creator>saurabh sharma</dc:creator><description>&lt;p&gt;is the code is correct . I dont have nay thing right now in the database . I just trying to create an expression rule&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Expression Rule</title><link>https://community.appian.com/thread/85660?ContentTypeID=1</link><pubDate>Fri, 10 Sep 2021 09:56:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4c3af45e-98ba-4b43-b8c4-82d5026b0e57</guid><dc:creator>Selvakumar Kumarasamy</dc:creator><description>&lt;p&gt;This error might occur due to several reasons. Please validate the points discussed in this thread-&lt;br /&gt;&lt;a href="https://community.appian.com/discussions/f/data/21042/unexpected-error-executing-query"&gt;community.appian.com/.../unexpected-error-executing-query&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Expression Rule</title><link>https://community.appian.com/thread/85659?ContentTypeID=1</link><pubDate>Fri, 10 Sep 2021 09:55:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c2d9b524-e3a8-489e-867f-525f0d274d21</guid><dc:creator>saurabh sharma</dc:creator><description>&lt;p&gt;Please help&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Expression Rule</title><link>https://community.appian.com/thread/85658?ContentTypeID=1</link><pubDate>Fri, 10 Sep 2021 09:51:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:26b30647-1323-4ff6-a552-e96d88999751</guid><dc:creator>saurabh sharma</dc:creator><description>&lt;p&gt;if&lt;br /&gt;(&lt;br /&gt; a!queryEntity(&lt;br /&gt; entity:&amp;lt;DSE_Constant&amp;gt;,&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; a!queryFilter(&lt;br /&gt; field: &amp;quot;siteid&amp;quot;,&lt;br /&gt; operator: &amp;quot;in&amp;quot;,&lt;br /&gt; value:{&amp;quot;AB000&amp;quot;,&amp;quot;AB0001&amp;quot;}&lt;br /&gt; )&lt;br /&gt; },&lt;br /&gt; ignoreFiltersWithEmptyValues: true&lt;br /&gt; ),&lt;br /&gt; pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 50)&lt;br /&gt; ),&lt;br /&gt; fetchTotalCount: false&lt;br /&gt;).data,&lt;br /&gt;&amp;quot;Present&amp;quot;,&amp;quot;Not Present&amp;quot;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Expression Rule</title><link>https://community.appian.com/thread/85655?ContentTypeID=1</link><pubDate>Fri, 10 Sep 2021 09:50:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:70285afa-7afa-4da3-bdc2-54bf8e6cb6f5</guid><dc:creator>Selvakumar Kumarasamy</dc:creator><description>&lt;p&gt;Can you please share your code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Expression Rule</title><link>https://community.appian.com/thread/85652?ContentTypeID=1</link><pubDate>Fri, 10 Sep 2021 09:43:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:05e660b3-5578-49b9-85a1-1e4c521c9aa8</guid><dc:creator>saurabh sharma</dc:creator><description>&lt;p&gt;I am getting this Error&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Expression evaluation error at function a!queryEntity [line 2]: An error occurred while retrieving the data. Details: Unexpected error executing query (type: [TWMDecomRequestSitesDT12021], query: [queryentity expression], order by: [[Sort[newlocationsiteid asc]]], filters:[(siteid in TypedValue[it=103,v={AB000,AB0001}])])&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Expression Rule</title><link>https://community.appian.com/thread/85646?ContentTypeID=1</link><pubDate>Fri, 10 Sep 2021 08:14:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4e230477-201c-4d9e-a820-6855086dbb0c</guid><dc:creator>Selvakumar Kumarasamy</dc:creator><description>&lt;p&gt;Yes, it will work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Expression Rule</title><link>https://community.appian.com/thread/85645?ContentTypeID=1</link><pubDate>Fri, 10 Sep 2021 08:13:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:482c62e4-7e9c-4c6c-ab5d-03a38f696d2b</guid><dc:creator>saurabh sharma</dc:creator><description>&lt;p&gt;if I am creating rule input as array in Expression Rule and then I put that rule input in value field . will it work for that&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Expression Rule</title><link>https://community.appian.com/thread/85643?ContentTypeID=1</link><pubDate>Fri, 10 Sep 2021 07:50:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:079558d4-1558-4723-ac74-1e8fd6cd7945</guid><dc:creator>Selvakumar Kumarasamy</dc:creator><description>&lt;p&gt;Here&amp;#39;s a sample code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!queryEntity(
  entity: &amp;lt;DSE_CONSTANT&amp;gt;,
  query: a!query(
    logicalExpression: a!queryLogicalExpression(
      operator: &amp;quot;AND&amp;quot;,
      filters: {
        a!queryFilter(
          field: &amp;quot;phoneNumber&amp;quot;,
          operator: &amp;quot;in&amp;quot;,
          value: { &amp;quot;12345&amp;quot;, &amp;quot;56789&amp;quot; }
        )
      },
      ignoreFiltersWithEmptyValues: true
    ),
    pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 50)
  ),
  fetchTotalCount: false
).data&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Expression Rule</title><link>https://community.appian.com/thread/85638?ContentTypeID=1</link><pubDate>Fri, 10 Sep 2021 07:01:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:105d394a-3604-4fcb-9f3b-1b7f1cb72532</guid><dc:creator>saurabh sharma</dc:creator><description>&lt;p&gt;In that How can I check with Multiple values (two or three) .&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Expression Rule</title><link>https://community.appian.com/thread/85637?ContentTypeID=1</link><pubDate>Fri, 10 Sep 2021 04:49:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:27f5a6a6-7e8f-4c5d-8ebb-e911d3badfbd</guid><dc:creator>Selvakumar Kumarasamy</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can use the&amp;nbsp;&lt;a href="https://docs.appian.com/suite/help/21.3/fnc_system_a_queryentity.html"&gt;a!queryEntity()&lt;/a&gt;&amp;nbsp;function to retrieve data from the database with the values as filters and based on the results you can return the boolean value.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>