<?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>Presenting Data from DB</title><link>https://community.appian.com/discussions/f/data/13472/presenting-data-from-db</link><description>Hello everyone, 
 I have a problem with presenting data from DB. There is short introdcution: 
 In SQL DB SERVER i have a table called email request and there are rows called id, request number, sender, title, recieved at, email body and folder id. This</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Presenting Data from DB</title><link>https://community.appian.com/thread/61579?ContentTypeID=1</link><pubDate>Mon, 15 Oct 2018 11:52:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:20c35c97-9d4c-4d58-90af-d2b390aec224</guid><dc:creator>bryant.st39</dc:creator><description>Without seeing your data structures, i&amp;#39;m guessing a little...try this...if this works, we can make it pretty later...&lt;br /&gt;
load(&lt;br /&gt;
  local!pagingInfo: a!pagingInfo(&lt;br /&gt;
    startIndex: 1,&lt;br /&gt;
    batchSize: 10&lt;br /&gt;
  ),&lt;br /&gt;
  with(&lt;br /&gt;
    local!emailData: if(&lt;br /&gt;
      rule!APN_isBlank(&lt;br /&gt;
        ri!requestNumber&lt;br /&gt;
      ),&lt;br /&gt;
      null,&lt;br /&gt;
      a!queryEntity(&lt;br /&gt;
        entity: cons!SAMPLEDATASTOREENTITY,&lt;br /&gt;
        query: a!query(&lt;br /&gt;
          filter: a!queryFilter(&lt;br /&gt;
            field: &amp;quot;requestNumber&amp;quot;,&lt;br /&gt;
            operator: &amp;quot;=&amp;quot;,&lt;br /&gt;
            value: ri!requestNumber&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;
    ),&lt;br /&gt;
    if(&lt;br /&gt;
      or(&lt;br /&gt;
        rule!APN_isBlank(&lt;br /&gt;
          ri!requestNumber&lt;br /&gt;
        ),&lt;br /&gt;
        local!emailData.totalCount = 0&lt;br /&gt;
      ),&lt;br /&gt;
      {},&lt;br /&gt;
      a!gridField(&lt;br /&gt;
        label: &amp;quot;mailing with branch&amp;quot;,&lt;br /&gt;
        labelPosition: &amp;quot;ABOVE&amp;quot;,&lt;br /&gt;
        totalCount: local!emailData.data.totalCount,&lt;br /&gt;
        columns: {&lt;br /&gt;
          a!gridTextColumn(&lt;br /&gt;
            label: &amp;quot;Sender&amp;quot;,&lt;br /&gt;
            data: {&lt;br /&gt;
              local!emailData.data.sender&lt;br /&gt;
            }&lt;br /&gt;
          ),&lt;br /&gt;
          a!gridTextColumn(&lt;br /&gt;
            label: &amp;quot;Updated By&amp;quot;,&lt;br /&gt;
            data: {&lt;br /&gt;
              local!emailData.data.updatedBy&lt;br /&gt;
            }&lt;br /&gt;
          ),&lt;br /&gt;
          a!gridTextColumn(&lt;br /&gt;
            label: &amp;quot;Updated On&amp;quot;,&lt;br /&gt;
            data: {&lt;br /&gt;
              local!emailData.data.updatedOn&lt;br /&gt;
            }&lt;br /&gt;
          ),&lt;br /&gt;
          a!gridTextColumn(&lt;br /&gt;
            label: &amp;quot;Date Received&amp;quot;,&lt;br /&gt;
            data: {&lt;br /&gt;
              local!emailData.data.receivedAt&lt;br /&gt;
            }&lt;br /&gt;
          ),&lt;br /&gt;
          a!gridTextColumn(&lt;br /&gt;
            label: &amp;quot;Error Type&amp;quot;,&lt;br /&gt;
            data: {&lt;br /&gt;
              local!emailData.data.errorType&lt;br /&gt;
            }&lt;br /&gt;
          ),&lt;br /&gt;
          a!gridTextColumn(&lt;br /&gt;
            label: &amp;quot;Error Type 2&amp;quot;,&lt;br /&gt;
            data: {&lt;br /&gt;
              local!emailData.data.errorType2&lt;br /&gt;
            }&lt;br /&gt;
          ),&lt;br /&gt;
          a!gridTextColumn(&lt;br /&gt;
            label: &amp;quot;Error Type 3&amp;quot;,&lt;br /&gt;
            data: {&lt;br /&gt;
              local!emailData.data.errorType3&lt;br /&gt;
            }&lt;br /&gt;
          ),&lt;br /&gt;
          a!gridTextColumn(&lt;br /&gt;
            label: &amp;quot;Error Type 4&amp;quot;,&lt;br /&gt;
            data: {&lt;br /&gt;
              local!emailData.data.errorType4&lt;br /&gt;
            }&lt;br /&gt;
          ),&lt;br /&gt;
          a!gridTextColumn(&lt;br /&gt;
            label: &amp;quot;Error Type 5&amp;quot;,&lt;br /&gt;
            data: {&lt;br /&gt;
              local!emailData.data.errorType5&lt;br /&gt;
            }&lt;br /&gt;
          ),&lt;br /&gt;
          a!gridTextColumn(&lt;br /&gt;
            label: &amp;quot;Error Details&amp;quot;,&lt;br /&gt;
            data: {&lt;br /&gt;
              local!emailData.data.errorDetails&lt;br /&gt;
            }&lt;br /&gt;
          ),&lt;br /&gt;
          a!gridTextColumn(&lt;br /&gt;
            label: &amp;quot;Email Body&amp;quot;,&lt;br /&gt;
            data: {&lt;br /&gt;
              local!emailData.data.emailBody&lt;br /&gt;
            }&lt;br /&gt;
          )&lt;br /&gt;
        },&lt;br /&gt;
        value: local!pagingInfo,&lt;br /&gt;
        saveInto: local!pagingInfo,&lt;br /&gt;
        disabled: false,&lt;br /&gt;
        validations: {},&lt;br /&gt;
        shadeAlternateRows: true&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: Presenting Data from DB</title><link>https://community.appian.com/thread/61578?ContentTypeID=1</link><pubDate>Mon, 15 Oct 2018 11:27:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:040268f7-aafa-4386-b213-77526c482737</guid><dc:creator>dawids0001</dc:creator><description>It works but id like to don&amp;#39;t have this specific number inside my brachet. There is one number for everysingle request so i tried this   rule!AA_getRequestemailbyRequestNumber(ri!request.requestNumber).emailBody as a test inside interface it works pretty good but when i&amp;#39;ve created a test case from action there is an error &amp;quot;Expression evaluation error in rule &amp;#39;aa_f_backofficeemployeetask&amp;#39; at function a!gridTextColumn [line 108]: Invalid index: Cannot index property &amp;#39;responder&amp;#39; of type Text into type List of Variant&amp;quot; so then i tried change it for this rule!AA_getRequestemailbyRequestNumber(ri!RequestemailbyRequestNumber.requestNumber).emailBody and there was a problem with batchsize and totall count so i change it works on test in action but it returns entire collumn emailbody from my table and there is completely mess. Can somebody help me get through  it. Thank you very much :)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Presenting Data from DB</title><link>https://community.appian.com/thread/61075?ContentTypeID=1</link><pubDate>Wed, 03 Oct 2018 14:41:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f84134b4-b02a-4e43-b67b-865e25007e38</guid><dc:creator>bryant.st39</dc:creator><description>You do not need the query (&amp;quot;AA_getRequestemailbyRequestNumber&amp;quot;) in the a!gridTextColumn unless it is querying data from another table.  To access a specific field in that query you could try rule!AA_getRequestemailbyRequestNumber(&amp;quot;AA-B-181002-557).thatSpecificField (or use the index function as described by Mike to handle situations with null values). Although, I suspect the field you want is already in the ri!request CDT.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Presenting Data from DB</title><link>https://community.appian.com/thread/61071?ContentTypeID=1</link><pubDate>Wed, 03 Oct 2018 14:28:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:61e0a61b-cbc7-4dd2-96d8-fa193cf9b8c8</guid><dc:creator>Mike Lasutschinkow</dc:creator><description>Hi dawids0001,&lt;br /&gt;
&lt;br /&gt;
From your screenshot, it looks like you are trying to display a form component in that grid column, instead of a text value.&lt;br /&gt;
&lt;br /&gt;
Are you expecting to see value &amp;quot;done; Poprawione&amp;quot; here? If so, check to see if you have that value wrapped in a component somewhere (for example, in my above post I used a text field as an example, but you would just want to put the value of local!emailBody into the grid text column instead of the text field). &lt;br /&gt;
&lt;br /&gt;
If that is not the value you are expecting, can you post the code you are using to generate this grid?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Presenting Data from DB</title><link>https://community.appian.com/thread/61069?ContentTypeID=1</link><pubDate>Wed, 03 Oct 2018 14:17:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0eae1bbb-f154-4a5a-a403-6c934f228070</guid><dc:creator>dawids0001</dc:creator><description>&lt;p&gt;It gave me below resulte:&lt;/p&gt;
&lt;p&gt;[@attributes=[@anyAttribute=[validationGroups:,requiredMessage:,_cId:6aba5f15b6e2bb4676dbfc5e0fdb47af], @nil=], label=, instructions=, required=, readOnly=, disabled=, placeholder=, value=done&lt;/p&gt;
&lt;p&gt;; Poprawione&lt;/p&gt;
&lt;p&gt;, validations=, saveInto=&amp;lt;&amp;lt;jA0EAwMCtBWatGjy+sIB0sB1Ad3r5dMThoeAbCFLzPCW3FqgJ3S70wpDF8dfJwzAUTf/i4lz08n5&lt;/p&gt;
&lt;p&gt;+G/DNFllDtPZbVIZbI/eoHIKXdwusnZwDcaRYBXEC54rwYDD90Qbvd342/PfXPz5qPia8rkHeq4D&lt;/p&gt;
&lt;p&gt;7DmSW02QCI++AD/RdT4cLNYd/6iVCMLH9lsmpm9b8EXpKCCQSydgLeEFPI+YumnU8/YP/q3jkgIL&lt;/p&gt;
&lt;p&gt;Hur6pjIeGAtqY42DdHIrE0WG2tbi3/beODQXE7NOXrb7zFwuoYTcqW2Qi6VOEaAs6GYt6MBWQroq&lt;/p&gt;
&lt;p&gt;BxWWKjgxOiVBVwvCRSPaQAekpXo8pDIj/e5c+LuSttsNGPETw20gF6hQ1qOCyO2zeGXh9lmkD4Z7&lt;/p&gt;
&lt;p&gt;zKhExvCiL42sAklggFhKHMK9ZTJJinknsxES1yzmDulDERS1OT4N36oU&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt;, refreshAfter=UNFOCUS, keyboard=STANDARD, labelPosition=ABOVE, align=DEFAULT, actions=, helpTooltip=, masked=]&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/cfs-file/__key/communityserver-discussions-components-files/16/shoot.PNG"&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/16/shoot.PNG" alt=" " /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Presenting Data from DB</title><link>https://community.appian.com/thread/61065?ContentTypeID=1</link><pubDate>Wed, 03 Oct 2018 13:49:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:631c0b61-591a-4e8d-a540-a0172676268b</guid><dc:creator>Mike Lasutschinkow</dc:creator><description>&lt;p&gt;For just returning the email body, you can use the index() function to pull it out.&lt;/p&gt;
&lt;p&gt;Example:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;=load(
  local!emailCdt: rule!AA_getRequestemailbyRequestNumber(&amp;quot;AA-B-181002-557&amp;quot;),
  local!emailBody: index(
    local!emailCdt,
    &amp;quot;emailBody&amp;quot;, /* replace with the correct field name */
    {}
  ),
  a!textField(value: local!emailBody)
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If you only want the email body whenever you use this query, you can further optimize by adding a selection to your query and selecting only the body text column you want returned.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Presenting Data from DB</title><link>https://community.appian.com/thread/61060?ContentTypeID=1</link><pubDate>Wed, 03 Oct 2018 13:38:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:476a18c3-75d5-403f-af14-045bae5079b5</guid><dc:creator>dawids0001</dc:creator><description>&lt;p&gt;a!gridField(&lt;br /&gt; label: &amp;quot;mailing with branch&amp;quot;,&lt;br /&gt; labelPosition: &amp;quot;ABOVE&amp;quot;,&lt;br /&gt; totalCount: 5,&lt;br /&gt; columns: {&lt;br /&gt; a!gridTextColumn(&lt;br /&gt; label: &amp;quot;Sender&amp;quot;,&lt;br /&gt; data: {ri!request.updatedBy, ri!requestemail.sender}&lt;br /&gt; ),&lt;br /&gt; a!gridTextColumn(&lt;br /&gt; label: &amp;quot;Date&amp;quot;,&lt;br /&gt; data: {ri!request.updatedOn, ri!requestemail.receivedAt}&lt;br /&gt; ),&lt;br /&gt; a!gridTextColumn(&lt;br /&gt; label: &amp;quot;Message Content&amp;quot;,&lt;br /&gt; data: {&amp;quot;Reasons for referral for improvement: &amp;quot;&amp;amp;&lt;br /&gt; ri!request.errorType&amp;amp;&amp;quot;.&amp;quot;&amp;amp;&lt;br /&gt; ri!request.errorType2 &amp;amp;&lt;br /&gt; ri!request.errorType3&amp;amp;&lt;br /&gt; ri!request.errorType4&amp;amp;&lt;br /&gt; ri!request.errorType5&amp;amp;&amp;quot; &amp;quot;&amp;amp;&lt;br /&gt; &amp;quot;Comment: &amp;quot;&amp;amp;&lt;br /&gt; ri!request.errorDetails,&lt;br /&gt; rule!AA_getRequestemailbyRequestNumber(&amp;quot;AA-B-181002-557&amp;quot;)} --------------/* WHEN I TYPE THIS NUMBER IT RETURNS BOTH EMAIL BODIES BUT IT RETURNS ENTIRE ROWS LIKE ID REQUEST NUMBER SENDER ETC HOW CAN I GET RID OF THIS EXCEPT EMAIL BODY */&lt;br /&gt; )&lt;br /&gt; },&lt;br /&gt; value: a!pagingInfo(startIndex: 1, batchSize: 10),&lt;br /&gt; saveInto: {},&lt;br /&gt; showwhen: or(ri!request.requestStatus=5, ri!request.requestStatus=10),&lt;br /&gt; disabled: false,&lt;br /&gt; validations: {},&lt;br /&gt; shadeAlternateRows: true&lt;br /&gt; )&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Presenting Data from DB</title><link>https://community.appian.com/thread/61047?ContentTypeID=1</link><pubDate>Wed, 03 Oct 2018 11:54:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:168bf30e-7152-4dc8-85a7-6d8ab10b41ba</guid><dc:creator>Logupriya Ramasamy</dc:creator><description>1) Check the database whether you have multiple entries for that request id&lt;br /&gt;
2) If DB has multiple rows, Check the pagination of the query since the query is returning value&lt;br /&gt;
3) If the query is returning multiple, then check the variable that you have passed whether it is multiple type or single type&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
Logu&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Presenting Data from DB</title><link>https://community.appian.com/thread/61045?ContentTypeID=1</link><pubDate>Wed, 03 Oct 2018 11:35:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cf414e9c-595f-45d2-a1b4-ed4348347df6</guid><dc:creator>bryant.st39</dc:creator><description>Test your query to make sure it is returning multiple rows.  If it is, check your input to your expression to make sure it is configured to accept an array as the input.  Please post the code for your grid and or interface for displaying the data.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>