<?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>how get a editable grid to accept a a!query entity</title><link>https://community.appian.com/discussions/f/user-interface/19222/how-get-a-editable-grid-to-accept-a-a-query-entity</link><description>how get a editable grid to accept a a!query entity 
 hi all so I am trying to attach an editable column to CDT with all of the info taken from the DB. 
 
 I have successfully got the CDT without the data in an editable grid 
 
 and got the data in a read</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: how get a editable grid to accept a a!query entity</title><link>https://community.appian.com/thread/75275?ContentTypeID=1</link><pubDate>Wed, 08 Jul 2020 18:39:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fc65c727-7186-4cf4-9bf1-9cbbbf050c88</guid><dc:creator>Peter Lewis</dc:creator><description>&lt;p&gt;The existing examples for editable grids are close (like &lt;a href="https://docs.appian.com/suite/help/latest/recipe-add-edit-and-remove-data-in-an-inline-editable-grid.html"&gt;this one&lt;/a&gt;), you just have to replace the sample data with the results of your query. For example, I can refactor the example above to use my data like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!employees: a!queryEntity(
    entity: cons!PDL_CASE_DSE,
    query: a!query(
      pagingInfo: a!pagingInfo(
        startIndex: 1,
        batchSize: 10
      )
    )
  ),
  a!formLayout(
    label: &amp;quot;Example: Add,Update, or Remove Employee Data&amp;quot;,
    contents: {
      a!gridLayout(
        totalCount: count(local!employees),
        headerCells: {
          a!gridLayoutHeaderCell(label: &amp;quot;Title&amp;quot; ),
          a!gridLayoutHeaderCell(label: &amp;quot;Description&amp;quot; ),
          a!gridLayoutHeaderCell(label: &amp;quot;Date&amp;quot; ),
          a!gridLayoutHeaderCell(label: &amp;quot;Priority&amp;quot; ),
          a!gridLayoutHeaderCell(label: &amp;quot;Status&amp;quot; ),
          /* For the &amp;quot;Remove&amp;quot; column */
          a!gridLayoutHeaderCell(label: &amp;quot;&amp;quot; )
        },
        /* Only needed when some columns need to be narrow */
        columnConfigs: {
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:3 ),
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:3 ),
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:3 ),
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:3 ),
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:3 ),
          a!gridLayoutColumnConfig(width: &amp;quot;ICON&amp;quot;)
        },
        /*
        * a!forEach() will take local!employee data and used that data to loop through an
        * expression that creates each row.
        *
        * When modifying the recipe to work with your data, you only need to change:
        * 1.) the number of fields in each row
        * 2.) the types of fields for each column (i.e. a!textField() for text data elements)
        * 3.) the fv!item elements. For example fv!item.firstName would change to fv!item.yourdata
        */
        rows: a!forEach(
          items: local!employees,
          expression: a!gridRowLayout(
            contents: {
              /* For the Title Column*/
              a!textField(
                value: fv!item.title,
                saveInto: fv!item.title,
                required: true
              ),
              /* For the Description Column*/
              a!textField(
                value: fv!item.description,
                saveInto: fv!item.description,
                required:true
              ),
              /* For the Department Column*/
              a!dateField(
                value: fv!item.date,
                saveInto: fv!item.date,
                required:true
              ),
              /* For the Priority Column*/
              a!textField(
                value: fv!item.priority,
                saveInto: fv!item.priority,
                required:true
              ),
              /* For the Status Column*/
              a!tagField(
                tags: a!tagItem(
                  text: fv!item.status
                )
              ),
              /* For the Removal Column*/
              a!richTextDisplayField(
                value: a!richTextIcon(
                  icon: &amp;quot;close&amp;quot;,
                  altText: &amp;quot;delete &amp;quot; &amp;amp; fv!index,
                  caption: &amp;quot;Remove &amp;quot; &amp;amp; fv!item.firstName &amp;amp; &amp;quot; &amp;quot; &amp;amp; fv!item.lastName,
                  link: a!dynamicLink(
                    value: fv!index,
                    saveInto: {
                      a!save(local!employees, remove(local!employees, save!value))
                    }
                  ),
                  linkStyle: &amp;quot;STANDALONE&amp;quot;,
                  color: &amp;quot;NEGATIVE&amp;quot;
                )
              )
            },
            id: fv!index
          )
        ),
        rowHeader: 1
      )
    },
    buttons: a!buttonLayout(
      primaryButtons: a!buttonWidget(
        label: &amp;quot;Submit&amp;quot;,
        submit: true
      )
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I also added a sample tag for your reference!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how get a editable grid to accept a a!query entity</title><link>https://community.appian.com/thread/75270?ContentTypeID=1</link><pubDate>Wed, 08 Jul 2020 15:31:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:410bcbc7-bbe8-46b3-bc44-ec252fb52424</guid><dc:creator>kevinr0001</dc:creator><description>&lt;p&gt;btw how can I add tags to it ? when I try it glitches out&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>