<?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>Can i access database table value using a constant?</title><link>https://community.appian.com/discussions/f/general/22609/can-i-access-database-table-value-using-a-constant</link><description>Hi, 
 
 I have a table where username and password is stored , now in an interface i want to access password based on the username, can it be possible to access data from dB using a constant in the interface?</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Can i access database table value using a constant?</title><link>https://community.appian.com/thread/88376?ContentTypeID=1</link><pubDate>Thu, 25 Nov 2021 23:17:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b5d83f6a-4913-449e-9617-9cd903b433e2</guid><dc:creator>ajhick</dc:creator><description>&lt;p&gt;I know this isn&amp;#39;t your question but why are you storing usernames and passwords in a database? I also wouldn&amp;#39;t suggest this, but if you&amp;#39;re going to use a constant to control what&amp;#39;s being retrieved from the database why not just directly store the password in the constant?&lt;/p&gt;
&lt;p&gt;We probably need a little more information to answer fully.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can i access database table value using a constant?</title><link>https://community.appian.com/thread/88371?ContentTypeID=1</link><pubDate>Thu, 25 Nov 2021 13:57:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b93d8f5a-58d6-44c5-abe3-b0f9ee86c09e</guid><dc:creator>Venkataswethapokuri</dc:creator><description>&lt;p&gt;&amp;nbsp;.&lt;pre class="ui-code" data-mode="text"&gt;a!queryEntity(
  entity: cons!TTC_USERDETAILS,
  query: a!query(
    logicalExpression: a!queryLogicalExpression(
      operator: &amp;quot;AND&amp;quot;,
      filters: {
        a!queryFilter(
          field: &amp;quot;userName&amp;quot;,
          operator: &amp;quot;=&amp;quot;,
          value: ri!userName
        )
      },
      ignoreFiltersWithEmptyValues: true
    ),
    pagingInfo: a!pagingInfo(
      startIndex: 1,
      batchSize: 50,
      sort: a!sortInfo(
        field: &amp;quot;userId&amp;quot;,
        ascending: true
      )
    )
  ),
  fetchTotalCount: false
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;By using a!queryentity we will fetch the data from the back end tables and directly we can use this expressions in the interface. for better understanding&lt;/p&gt;
&lt;p&gt;please go through the above code .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can i access database table value using a constant?</title><link>https://community.appian.com/thread/88364?ContentTypeID=1</link><pubDate>Thu, 25 Nov 2021 11:21:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4bed2dc9-c88b-4d8d-a057-f8f56643711a</guid><dc:creator>Furman</dc:creator><description>&lt;p&gt;I would rather use Appian expression and&amp;nbsp;a!queryEntity function.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>