<?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>Is there a possible way to add rownum column in readonly grid?</title><link>https://community.appian.com/discussions/f/new-to-appian/25299/is-there-a-possible-way-to-add-rownum-column-in-readonly-grid</link><description>Hello, 
 Is there a possible way to add rownum column in readonly grid? 
 If possible, it would be appreciated if you could attach an example for reference. 
 Thank you.</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Is there a possible way to add rownum column in readonly grid?</title><link>https://community.appian.com/thread/98982?ContentTypeID=1</link><pubDate>Thu, 04 Aug 2022 09:02:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3cb4a385-6d89-41d1-a0eb-f36a9548360e</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;While this is becoming complicated and I really suggest to push back this requirement, an option might be to update the identifiers field of your datasubset to the above mentioned enumeration. Then you can just use fv!identifier.&lt;/p&gt;
&lt;p&gt;Check this untested code you will have to adapt to your needs.&lt;/p&gt;
&lt;p&gt;a!update(local!yourDatasubset, &amp;quot;identifiers&amp;quot;, local!pagingInfo.startIndex + enumerate(local!pagingInfo.batchSize))&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!pInfo: a!pagingInfo(10, 10),
  local!data: a!dataSubset(
    startIndex: local!pInfo.startIndex,
    batchSize: local!pInfo.batchSize,
    totalCount: 100,
    data: a!forEach(
      items: enumerate(10),
      expression: a!map(value: char(fv!index + 60))
    ),
  ),
  {
    a!gridField(
      label: &amp;quot;Read-only Grid&amp;quot;,
      labelPosition: &amp;quot;ABOVE&amp;quot;,
      data: a!update(
        data: local!data,
        index: &amp;quot;identifiers&amp;quot;,
        value: local!data.startIndex + enumerate(local!data.batchSize)
      ),
      pagingSaveInto: local!pInfo,
      columns: {
        a!gridColumn(
          label: &amp;quot;Grid Column&amp;quot;,
          value: fv!identifier
        ),
        a!gridColumn(
          label: &amp;quot;Grid Column&amp;quot;,
          value: fv!row.value
        ),
      },
      validations: {}
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a possible way to add rownum column in readonly grid?</title><link>https://community.appian.com/thread/98981?ContentTypeID=1</link><pubDate>Thu, 04 Aug 2022 08:50:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1ff1d30f-6ada-4eb5-ac13-b1aee056144f</guid><dc:creator>Richard Michaelis</dc:creator><description>&lt;p&gt;do you have your code available to post it here? its easier to correct than a picture. but i seems like you are inserting the local instead of fv!row/fv!Item&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a possible way to add rownum column in readonly grid?</title><link>https://community.appian.com/thread/98980?ContentTypeID=1</link><pubDate>Thu, 04 Aug 2022 08:44:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c59c5c53-e948-44b7-b864-68642f40f8c5</guid><dc:creator>dreamyoung</dc:creator><description>&lt;p&gt;enumerated value shows up in th e read-only grid lik [ 1; 2; 3; ].&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/62/pastedimage1659602673857v2.png" /&gt;&lt;/p&gt;
&lt;p&gt;How can I make it show one number for each row?&lt;/p&gt;
&lt;p&gt;(Data source for the read-only grid is record type.)&lt;/p&gt;
&lt;div style="left:120px;position:absolute;top:329.811px;" id="gtx-trans"&gt;
&lt;div class="gtx-trans-icon"&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a possible way to add rownum column in readonly grid?</title><link>https://community.appian.com/thread/98902?ContentTypeID=1</link><pubDate>Wed, 03 Aug 2022 08:26:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:22a596df-084b-4724-8cef-d7e3cc422f72</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;What exactly do you want to know about enumerate() besides what can be found in the documentation?&lt;/p&gt;
&lt;p&gt;How to add an offset? 42 + enumerate(10) -&amp;gt; 42, 43, 44, 45 ...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a possible way to add rownum column in readonly grid?</title><link>https://community.appian.com/thread/98892?ContentTypeID=1</link><pubDate>Wed, 03 Aug 2022 05:22:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ebe1e545-eb79-46d1-8873-3b5eff291f91</guid><dc:creator>dreamyoung</dc:creator><description>&lt;p&gt;That&amp;#39;s right, fv!identifier&amp;nbsp;retrieves the value of the primary key column, so not suite for rownum&amp;nbsp;use.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I&amp;#39;m using read-only grid with record type as its data source.&lt;/p&gt;
&lt;p&gt;I want to know more about generating a list of number using the enumerate() function, could you provide any example code for it?&lt;/p&gt;
&lt;p&gt;Thank you. Always wish the best for you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a possible way to add rownum column in readonly grid?</title><link>https://community.appian.com/thread/98316?ContentTypeID=1</link><pubDate>Mon, 25 Jul 2022 08:56:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:07f2ae5d-8386-4a0e-8a99-7aba8d41b3cb</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;When you fetch the data from DB, fv!identifier will contain the values from the primary key column.&lt;/p&gt;
&lt;p&gt;You could generate a list of number using the enumerate() function and use this as the value of a gridColumn. You might have to consider paging and create this list of numbers with a dynamic offset based on the paging info.&lt;/p&gt;
&lt;p&gt;But before diving into this, what is your use case?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a possible way to add rownum column in readonly grid?</title><link>https://community.appian.com/thread/98315?ContentTypeID=1</link><pubDate>Mon, 25 Jul 2022 08:49:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:178837d5-acb5-4aed-85fd-bcb3ad32b486</guid><dc:creator>deepakg681722</dc:creator><description>&lt;p&gt;Hey please find the attached code. You can use fv!identifier for the same.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!data: {
    { a: 1, b: 2, c: 3 },
    { a: 4, b: 5, c: 6 },
    { a: 7, b: 8, c: 9 },
    { a: 10, b: 11, c: 12 },
    { a: 13, b: 14, c: 15 }
  },
  a!gridField(
    data: local!data,
    columns: {
      a!gridColumn(value: fv!identifier),
      a!gridColumn(label: &amp;quot;A&amp;quot;, value: fv!row.a),
      a!gridColumn(label: &amp;quot;B&amp;quot;, value: fv!row.a),
      a!gridColumn(label: &amp;quot;C&amp;quot;, value: fv!row.a)
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>