<?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>Editable Grid SAIL</title><link>https://community.appian.com/discussions/f/user-interface/11814/editable-grid-sail</link><description>I tried the following SAIL recipe which worked well with Employees CDT as ri! parameter for adding rows. I thought deletion would also be done by the same call using write to datastore smart service in a kind of merging but it did not. I am trying to</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Editable Grid SAIL</title><link>https://community.appian.com/thread/52244?ContentTypeID=1</link><pubDate>Sat, 03 Feb 2018 15:09:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6caa8abf-c969-4f20-8d87-351b6352d1ed</guid><dc:creator>sudhakaraa0001</dc:creator><description>I could make the functionality work well by doing some changes. The following code works very well for inserts/deletes at the same time and also does not depend on the surrogate keys ( entity primary keys ) for being contiguous and match the count of rows.&lt;br /&gt;
&lt;br /&gt;
=load(&lt;br /&gt;
  a!formLayout(&lt;br /&gt;
    label: &amp;quot;SAIL Example: Add,Update, or Remove Employee Data&amp;quot;,&lt;br /&gt;
    contents: {&lt;br /&gt;
      a!gridLayout(&lt;br /&gt;
      totalCount: count(ri!Employees),&lt;br /&gt;
        headerCells: {&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;id&amp;quot; ),&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;First Name&amp;quot; ),&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;Last Name&amp;quot; ),&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;Department&amp;quot; ),&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;Title&amp;quot; ),&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;Phone Number&amp;quot; ),&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;Start Date&amp;quot;, align: &amp;quot;RIGHT&amp;quot; ),&lt;br /&gt;
          /* For the &amp;quot;Remove&amp;quot; column */&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;&amp;quot; )&lt;br /&gt;
        },&lt;br /&gt;
        /* Only needed when some columns need to be narrow */&lt;br /&gt;
        columnConfigs: {&lt;br /&gt;
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:3 ),&lt;br /&gt;
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:3 ),&lt;br /&gt;
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:3 ),&lt;br /&gt;
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:3 ),&lt;br /&gt;
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:3 ),&lt;br /&gt;
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:3 ),&lt;br /&gt;
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:2 ),&lt;br /&gt;
          a!gridLayoutColumnConfig(width: &amp;quot;ICON&amp;quot;)&lt;br /&gt;
        },&lt;br /&gt;
        rows: a!forEach(&lt;br /&gt;
          items: ri!Employees,&lt;br /&gt;
          expression: a!gridRowLayout(&lt;br /&gt;
            contents: {&lt;br /&gt;
              a!integerField(&lt;br /&gt;
                /* Labels are not visible in grid cells but are necessary to meet accessibility requirements */&lt;br /&gt;
                label: &amp;quot;id &amp;quot; &amp;amp; fv!item.id,&lt;br /&gt;
                value: fv!item.id,&lt;br /&gt;
                saveInto: fv!item.id,&lt;br /&gt;
                required: true&lt;br /&gt;
              ),&lt;br /&gt;
              /* For the First Name Column*/&lt;br /&gt;
              a!textField(&lt;br /&gt;
                /* Labels are not visible in grid cells but are necessary to meet accessibility requirements */&lt;br /&gt;
                label: &amp;quot;first name &amp;quot; &amp;amp; fv!item.id,&lt;br /&gt;
                value: fv!item.firstName,&lt;br /&gt;
                saveInto: fv!item.firstName,&lt;br /&gt;
                required: true&lt;br /&gt;
              ),&lt;br /&gt;
              /* For the Last Name Column*/&lt;br /&gt;
              a!textField(&lt;br /&gt;
                label: &amp;quot;last name &amp;quot; &amp;amp; fv!item.id,&lt;br /&gt;
                value: fv!item.lastName,&lt;br /&gt;
                saveInto: fv!item.lastName,&lt;br /&gt;
                required:true&lt;br /&gt;
              ),&lt;br /&gt;
              /* For the Department Column*/&lt;br /&gt;
              a!dropdownField(&lt;br /&gt;
                label: &amp;quot;department &amp;quot; &amp;amp; fv!item.id,&lt;br /&gt;
                placeholderLabel: &amp;quot;-- Select -- &amp;quot;,&lt;br /&gt;
                choiceLabels: { &amp;quot;Corporate&amp;quot;, &amp;quot;Engineering&amp;quot;, &amp;quot;Finance&amp;quot;, &amp;quot;Human Resources&amp;quot;, &amp;quot;Professional Services&amp;quot;, &amp;quot;Sales&amp;quot; },&lt;br /&gt;
                choiceValues: { &amp;quot;Corporate&amp;quot;, &amp;quot;Engineering&amp;quot;, &amp;quot;Finance&amp;quot;, &amp;quot;HR&amp;quot;, &amp;quot;Professional Services&amp;quot;, &amp;quot;Sales&amp;quot; },&lt;br /&gt;
                value: fv!item.department,&lt;br /&gt;
                saveInto: fv!item.department,&lt;br /&gt;
                required:true&lt;br /&gt;
              ),&lt;br /&gt;
              /* For the Title Column*/&lt;br /&gt;
              a!textField(&lt;br /&gt;
                label: &amp;quot;title &amp;quot; &amp;amp; fv!item.id,&lt;br /&gt;
                value: fv!item.title,&lt;br /&gt;
                saveInto: fv!item.title,&lt;br /&gt;
                required:true&lt;br /&gt;
              ),&lt;br /&gt;
              /* For the Phone Number Column*/&lt;br /&gt;
              a!textField(&lt;br /&gt;
                label: &amp;quot;phone number &amp;quot; &amp;amp; fv!item.id,&lt;br /&gt;
                placeholder:&amp;quot;123-456-7890&amp;quot;,&lt;br /&gt;
                value: fv!item.phoneNumber,&lt;br /&gt;
                saveInto: fv!item.phoneNumber&lt;br /&gt;
              ),&lt;br /&gt;
              /* For the Start Date Column*/&lt;br /&gt;
              a!dateField(&lt;br /&gt;
                label: &amp;quot;start date &amp;quot; &amp;amp; fv!item.id,&lt;br /&gt;
                value: fv!item.startDate,&lt;br /&gt;
                saveInto: fv!item.startDate,&lt;br /&gt;
                required:true,&lt;br /&gt;
                align: &amp;quot;RIGHT&amp;quot;&lt;br /&gt;
              ),&lt;br /&gt;
              /* For the Removal Column*/&lt;br /&gt;
              a!imageField(&lt;br /&gt;
                label: &amp;quot;delete &amp;quot; &amp;amp; fv!item.id,&lt;br /&gt;
                images: a!documentImage(&lt;br /&gt;
                  document: a!iconIndicator(&amp;quot;REMOVE&amp;quot;),&lt;br /&gt;
                  altText: &amp;quot;Remove Employee&amp;quot;,&lt;br /&gt;
                  caption: &amp;quot;Remove &amp;quot; &amp;amp; fv!item.firstName &amp;amp; &amp;quot; &amp;quot; &amp;amp; fv!item.lastName,&lt;br /&gt;
                  link: a!dynamicLink(&lt;br /&gt;
                    value: fv!item.id,&lt;br /&gt;
                    saveInto: {&lt;br /&gt;
                      a!save(ri!DeletedEmployees, append(ri!DeletedEmployees, fv!item.id)),&lt;br /&gt;
                      a!save(ri!Employees, remove(ri!Employees, wherecontains(ri!DeletedEmployees, ri!Employees.id))),&lt;br /&gt;
                   a!deleteFromDataStoreEntities(&lt;br /&gt;
                    a!entityDataIdentifiers(&lt;br /&gt;
                      entity: cons!DS_ENTITY_REF_EMPLOYEE,&lt;br /&gt;
                      identifiers: ri!DeletedEmployees&lt;br /&gt;
                   )&lt;br /&gt;
                  )&lt;br /&gt;
                    }&lt;br /&gt;
                  )&lt;br /&gt;
                ),&lt;br /&gt;
                size: &amp;quot;ICON&amp;quot;&lt;br /&gt;
              )&lt;br /&gt;
            },&lt;br /&gt;
            id: fv!item.id&lt;br /&gt;
          )&lt;br /&gt;
        )&lt;br /&gt;
        , &lt;br /&gt;
        addRowlink: a!dynamicLink(&lt;br /&gt;
          label: &amp;quot;Add Employee&amp;quot;,&lt;br /&gt;
          /*&lt;br /&gt;
           * For your use case, set the value to a blank instance of your CDT using&lt;br /&gt;
           * the type constructor, e.g. type!Employee(). Only specify the field&lt;br /&gt;
           * if you want to give it a default value e.g. startDate: today()+1.&lt;br /&gt;
           */&lt;br /&gt;
          value: &amp;#39;type!{urn:com:appian:types}Employee&amp;#39;(),&lt;br /&gt;
          saveInto: {&lt;br /&gt;
            a!save(ri!Employees, append(ri!Employees,save!value))&lt;br /&gt;
          }&lt;br /&gt;
        )&lt;br /&gt;
      )&lt;br /&gt;
    },&lt;br /&gt;
    buttons: a!buttonLayout(&lt;br /&gt;
      primaryButtons: a!buttonWidgetSubmit(&lt;br /&gt;
        label: &amp;quot;Submit&amp;quot;,&lt;br /&gt;
        saveInto:{ &lt;br /&gt;
                a!save(ri!DeletedEmployees, {}),&lt;br /&gt;
                a!writeToDataStoreEntity(&lt;br /&gt;
                  dataStoreEntity: cons!DS_ENTITY_REF_EMPLOYEE,&lt;br /&gt;
                  valueToStore: ri!Employees&lt;br /&gt;
                   )&lt;br /&gt;
              }&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: Editable Grid SAIL</title><link>https://community.appian.com/thread/52242?ContentTypeID=1</link><pubDate>Sat, 03 Feb 2018 14:59:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ace18e27-a70d-4860-bbed-b8dc559c91ee</guid><dc:creator>sudhakaraa0001</dc:creator><description>I could make this work with the following code. I had to replace fv!index with fv!item and remove deleted ids from employees at submit time. I am working with a table where the surrogate keys are arbitrary and count does not match with next id. There seems to be a validation in REMOVE wherein it does not allow me to delete a row whose id does not math with the count of items in the grid. Only draw back is that user would not see the deleted row going out of screen till the period of pressing SUBMIT button. Is there any refresh function which could be called to update the grid?&lt;br /&gt;
&lt;br /&gt;
=load(&lt;br /&gt;
  a!formLayout(&lt;br /&gt;
    label: &amp;quot;SAIL Example: Add,Update, or Remove Employee Data&amp;quot;,&lt;br /&gt;
    contents: {&lt;br /&gt;
      a!gridLayout(&lt;br /&gt;
      totalCount: count(ri!Employees),&lt;br /&gt;
        headerCells: {&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;id&amp;quot; ),&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;First Name&amp;quot; ),&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;Last Name&amp;quot; ),&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;Department&amp;quot; ),&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;Title&amp;quot; ),&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;Phone Number&amp;quot; ),&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;Start Date&amp;quot;, align: &amp;quot;RIGHT&amp;quot; ),&lt;br /&gt;
          /* For the &amp;quot;Remove&amp;quot; column */&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;&amp;quot; )&lt;br /&gt;
        },&lt;br /&gt;
        /* Only needed when some columns need to be narrow */&lt;br /&gt;
        columnConfigs: {&lt;br /&gt;
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:3 ),&lt;br /&gt;
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:3 ),&lt;br /&gt;
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:3 ),&lt;br /&gt;
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:3 ),&lt;br /&gt;
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:3 ),&lt;br /&gt;
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:3 ),&lt;br /&gt;
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:2 ),&lt;br /&gt;
          a!gridLayoutColumnConfig(width: &amp;quot;ICON&amp;quot;)&lt;br /&gt;
        },&lt;br /&gt;
        rows: a!forEach(&lt;br /&gt;
          items: ri!Employees,&lt;br /&gt;
          expression: a!gridRowLayout(&lt;br /&gt;
            contents: {&lt;br /&gt;
              a!integerField(&lt;br /&gt;
                /* Labels are not visible in grid cells but are necessary to meet accessibility requirements */&lt;br /&gt;
                label: &amp;quot;id &amp;quot; &amp;amp; fv!item.id,&lt;br /&gt;
                value: fv!item.id,&lt;br /&gt;
                saveInto: fv!item.id,&lt;br /&gt;
                required: true&lt;br /&gt;
              ),&lt;br /&gt;
              /* For the First Name Column*/&lt;br /&gt;
              a!textField(&lt;br /&gt;
                /* Labels are not visible in grid cells but are necessary to meet accessibility requirements */&lt;br /&gt;
                label: &amp;quot;first name &amp;quot; &amp;amp; fv!item.id,&lt;br /&gt;
                value: fv!item.firstName,&lt;br /&gt;
                saveInto: fv!item.firstName,&lt;br /&gt;
                required: true&lt;br /&gt;
              ),&lt;br /&gt;
              /* For the Last Name Column*/&lt;br /&gt;
              a!textField(&lt;br /&gt;
                label: &amp;quot;last name &amp;quot; &amp;amp; fv!item.id,&lt;br /&gt;
                value: fv!item.lastName,&lt;br /&gt;
                saveInto: fv!item.lastName,&lt;br /&gt;
                required:true&lt;br /&gt;
              ),&lt;br /&gt;
              /* For the Department Column*/&lt;br /&gt;
              a!dropdownField(&lt;br /&gt;
                label: &amp;quot;department &amp;quot; &amp;amp; fv!item.id,&lt;br /&gt;
                placeholderLabel: &amp;quot;-- Select -- &amp;quot;,&lt;br /&gt;
                choiceLabels: { &amp;quot;Corporate&amp;quot;, &amp;quot;Engineering&amp;quot;, &amp;quot;Finance&amp;quot;, &amp;quot;Human Resources&amp;quot;, &amp;quot;Professional Services&amp;quot;, &amp;quot;Sales&amp;quot; },&lt;br /&gt;
                choiceValues: { &amp;quot;Corporate&amp;quot;, &amp;quot;Engineering&amp;quot;, &amp;quot;Finance&amp;quot;, &amp;quot;HR&amp;quot;, &amp;quot;Professional Services&amp;quot;, &amp;quot;Sales&amp;quot; },&lt;br /&gt;
                value: fv!item.department,&lt;br /&gt;
                saveInto: fv!item.department,&lt;br /&gt;
                required:true&lt;br /&gt;
              ),&lt;br /&gt;
              /* For the Title Column*/&lt;br /&gt;
              a!textField(&lt;br /&gt;
                label: &amp;quot;title &amp;quot; &amp;amp; fv!item.id,&lt;br /&gt;
                value: fv!item.title,&lt;br /&gt;
                saveInto: fv!item.title,&lt;br /&gt;
                required:true&lt;br /&gt;
              ),&lt;br /&gt;
              /* For the Phone Number Column*/&lt;br /&gt;
              a!textField(&lt;br /&gt;
                label: &amp;quot;phone number &amp;quot; &amp;amp; fv!item.id,&lt;br /&gt;
                placeholder:&amp;quot;123-456-7890&amp;quot;,&lt;br /&gt;
                value: fv!item.phoneNumber,&lt;br /&gt;
                saveInto: fv!item.phoneNumber&lt;br /&gt;
              ),&lt;br /&gt;
              /* For the Start Date Column*/&lt;br /&gt;
              a!dateField(&lt;br /&gt;
                label: &amp;quot;start date &amp;quot; &amp;amp; fv!item.id,&lt;br /&gt;
                value: fv!item.startDate,&lt;br /&gt;
                saveInto: fv!item.startDate,&lt;br /&gt;
                required:true,&lt;br /&gt;
                align: &amp;quot;RIGHT&amp;quot;&lt;br /&gt;
              ),&lt;br /&gt;
              /* For the Removal Column*/&lt;br /&gt;
              a!imageField(&lt;br /&gt;
                label: &amp;quot;delete &amp;quot; &amp;amp; fv!item.id,&lt;br /&gt;
                images: a!documentImage(&lt;br /&gt;
                  document: a!iconIndicator(&amp;quot;REMOVE&amp;quot;),&lt;br /&gt;
                  altText: &amp;quot;Remove Employee&amp;quot;,&lt;br /&gt;
                  caption: &amp;quot;Remove &amp;quot; &amp;amp; fv!item.firstName &amp;amp; &amp;quot; &amp;quot; &amp;amp; fv!item.lastName,&lt;br /&gt;
                  link: a!dynamicLink(&lt;br /&gt;
                    value: fv!item.id,&lt;br /&gt;
                    saveInto: {&lt;br /&gt;
                      a!save(ri!DeletedEmployees, append(ri!DeletedEmployees, fv!item.id)),&lt;br /&gt;
                   a!deleteFromDataStoreEntities(&lt;br /&gt;
                    a!entityDataIdentifiers(&lt;br /&gt;
                      entity: cons!DS_ENTITY_REF_EMPLOYEE,&lt;br /&gt;
                      identifiers: ri!DeletedEmployees&lt;br /&gt;
                   )&lt;br /&gt;
                  )&lt;br /&gt;
                    }&lt;br /&gt;
                  )&lt;br /&gt;
                ),&lt;br /&gt;
                size: &amp;quot;ICON&amp;quot;&lt;br /&gt;
              )&lt;br /&gt;
            },&lt;br /&gt;
            id: fv!item.id&lt;br /&gt;
          )&lt;br /&gt;
        )&lt;br /&gt;
        , &lt;br /&gt;
        addRowlink: a!dynamicLink(&lt;br /&gt;
          label: &amp;quot;Add Employee&amp;quot;,&lt;br /&gt;
          value: &amp;#39;type!{urn:com:appian:types}Employee&amp;#39;(),&lt;br /&gt;
          saveInto: {&lt;br /&gt;
            a!save(ri!Employees, append(ri!Employees,save!value))&lt;br /&gt;
          }&lt;br /&gt;
        )&lt;br /&gt;
      )&lt;br /&gt;
    },&lt;br /&gt;
    buttons: a!buttonLayout(&lt;br /&gt;
      primaryButtons: a!buttonWidgetSubmit(&lt;br /&gt;
        label: &amp;quot;Submit&amp;quot;,&lt;br /&gt;
        saveInto:{ a!save(ri!Employees, remove(ri!Employees, wherecontains(ri!DeletedEmployees, ri!Employees.id))),&lt;br /&gt;
                a!save(ri!DeletedEmployees, {}),&lt;br /&gt;
                a!writeToDataStoreEntity(&lt;br /&gt;
                  dataStoreEntity: cons!DS_ENTITY_REF_EMPLOYEE,&lt;br /&gt;
                  valueToStore: ri!Employees&lt;br /&gt;
                   )&lt;br /&gt;
              }&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: Editable Grid SAIL</title><link>https://community.appian.com/thread/52236?ContentTypeID=1</link><pubDate>Fri, 02 Feb 2018 18:22:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bda00efd-166a-4834-a6e4-26a31d5f311c</guid><dc:creator>sudhakaraa0001</dc:creator><description>I tried to make the inline editable grid work to log the correct primary ids. What I understood so far is that 1) The editable fv.index is being used for validations and also fv.item.id is actually the next row id instead of the one being deleted. Also, it seems there may be some dependency on primary ids to be sequential without any deletes. Who would be the guru on this subject to discuss on the right code pattern that works as expected?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid SAIL</title><link>https://community.appian.com/thread/52220?ContentTypeID=1</link><pubDate>Fri, 02 Feb 2018 13:15:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:85269242-ee40-4a7e-b560-180f536de3f5</guid><dc:creator>sudhakaraa0001</dc:creator><description>The following code worked for me in doing both insert and delete at the same time. I used with function which refreshed after a delete has happened which comes just after the &amp;quot;X&amp;quot; sign is activated on a record. It actually mimics doing insert and deletes at separate time periods which most probably is appropriate for editable grids. I am still figuring out on why the row.id is not being logged properly.&lt;br /&gt;
&lt;br /&gt;
=load(&lt;br /&gt;
  with(&lt;br /&gt;
  a!formLayout(&lt;br /&gt;
    label: &amp;quot;SAIL Example: Add,Update, or Remove Employee Data&amp;quot;,&lt;br /&gt;
    contents: {&lt;br /&gt;
      a!gridLayout(&lt;br /&gt;
        totalCount: count(ri!Employees),&lt;br /&gt;
        headerCells: {&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;id&amp;quot; ),&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;First Name&amp;quot; ),&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;Last Name&amp;quot; ),&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;Department&amp;quot; ),&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;Title&amp;quot; ),&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;Phone Number&amp;quot; ),&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;Start Date&amp;quot;, align: &amp;quot;RIGHT&amp;quot; ),&lt;br /&gt;
          /* For the &amp;quot;Remove&amp;quot; column */&lt;br /&gt;
          a!gridLayoutHeaderCell(label: &amp;quot;&amp;quot; )&lt;br /&gt;
        },&lt;br /&gt;
        /* Only needed when some columns need to be narrow */&lt;br /&gt;
        columnConfigs: {&lt;br /&gt;
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:3 ),&lt;br /&gt;
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:3 ),&lt;br /&gt;
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:3 ),&lt;br /&gt;
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:3 ),&lt;br /&gt;
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:3 ),&lt;br /&gt;
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:3 ),&lt;br /&gt;
          a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;, weight:2 ),&lt;br /&gt;
          a!gridLayoutColumnConfig(width: &amp;quot;ICON&amp;quot;)&lt;br /&gt;
        },&lt;br /&gt;
        rows: a!forEach(&lt;br /&gt;
          items: ri!Employees,&lt;br /&gt;
          expression: a!gridRowLayout(&lt;br /&gt;
            contents: {&lt;br /&gt;
              a!integerField(&lt;br /&gt;
                /* Labels are not visible in grid cells but are necessary to meet accessibility requirements */&lt;br /&gt;
                label: &amp;quot;first name &amp;quot; &amp;amp; fv!index,&lt;br /&gt;
                value: fv!item.id,&lt;br /&gt;
                saveInto: fv!item.id,&lt;br /&gt;
                required: true&lt;br /&gt;
              ),&lt;br /&gt;
              /* For the First Name Column*/&lt;br /&gt;
              a!textField(&lt;br /&gt;
                /* Labels are not visible in grid cells but are necessary to meet accessibility requirements */&lt;br /&gt;
                label: &amp;quot;first name &amp;quot; &amp;amp; fv!index,&lt;br /&gt;
                value: fv!item.firstName,&lt;br /&gt;
                saveInto: fv!item.firstName,&lt;br /&gt;
                required: true&lt;br /&gt;
              ),&lt;br /&gt;
              /* For the Last Name Column*/&lt;br /&gt;
              a!textField(&lt;br /&gt;
                label: &amp;quot;last name &amp;quot; &amp;amp; fv!index,&lt;br /&gt;
                value: fv!item.lastName,&lt;br /&gt;
                saveInto: fv!item.lastName,&lt;br /&gt;
                required:true&lt;br /&gt;
              ),&lt;br /&gt;
              /* For the Department Column*/&lt;br /&gt;
              a!dropdownField(&lt;br /&gt;
                label: &amp;quot;department &amp;quot; &amp;amp; fv!index,&lt;br /&gt;
                placeholderLabel: &amp;quot;-- Select -- &amp;quot;,&lt;br /&gt;
                choiceLabels: { &amp;quot;Corporate&amp;quot;, &amp;quot;Engineering&amp;quot;, &amp;quot;Finance&amp;quot;, &amp;quot;Human Resources&amp;quot;, &amp;quot;Professional Services&amp;quot;, &amp;quot;Sales&amp;quot; },&lt;br /&gt;
                choiceValues: { &amp;quot;Corporate&amp;quot;, &amp;quot;Engineering&amp;quot;, &amp;quot;Finance&amp;quot;, &amp;quot;HR&amp;quot;, &amp;quot;Professional Services&amp;quot;, &amp;quot;Sales&amp;quot; },&lt;br /&gt;
                value: fv!item.department,&lt;br /&gt;
                saveInto: fv!item.department,&lt;br /&gt;
                required:true&lt;br /&gt;
              ),&lt;br /&gt;
              /* For the Title Column*/&lt;br /&gt;
              a!textField(&lt;br /&gt;
                label: &amp;quot;title &amp;quot; &amp;amp; fv!index,&lt;br /&gt;
                value: fv!item.title,&lt;br /&gt;
                saveInto: fv!item.title,&lt;br /&gt;
                required:true&lt;br /&gt;
              ),&lt;br /&gt;
              /* For the Phone Number Column*/&lt;br /&gt;
              a!textField(&lt;br /&gt;
                label: &amp;quot;phone number &amp;quot; &amp;amp; fv!index,&lt;br /&gt;
                placeholder:&amp;quot;123-456-7890&amp;quot;,&lt;br /&gt;
                value: fv!item.phoneNumber,&lt;br /&gt;
                saveInto: fv!item.phoneNumber&lt;br /&gt;
              ),&lt;br /&gt;
              /* For the Start Date Column*/&lt;br /&gt;
              a!dateField(&lt;br /&gt;
                label: &amp;quot;start date &amp;quot; &amp;amp; fv!index,&lt;br /&gt;
                value: fv!item.startDate,&lt;br /&gt;
                saveInto: fv!item.startDate,&lt;br /&gt;
                required:true,&lt;br /&gt;
                align: &amp;quot;RIGHT&amp;quot;&lt;br /&gt;
              ),&lt;br /&gt;
              /* For the Removal Column*/&lt;br /&gt;
              a!imageField(&lt;br /&gt;
                label: &amp;quot;delete &amp;quot; &amp;amp; fv!index,&lt;br /&gt;
                images: a!documentImage(&lt;br /&gt;
                  document: a!iconIndicator(&amp;quot;REMOVE&amp;quot;),&lt;br /&gt;
                  altText: &amp;quot;Remove Employee&amp;quot;,&lt;br /&gt;
                  caption: &amp;quot;Remove &amp;quot; &amp;amp; fv!item.firstName &amp;amp; &amp;quot; &amp;quot; &amp;amp; fv!item.lastName,&lt;br /&gt;
                  link: a!dynamicLink(&lt;br /&gt;
                    value: fv!index,&lt;br /&gt;
                    saveInto: {&lt;br /&gt;
                      a!save(ri!Employees, remove(ri!Employees, save!value)),&lt;br /&gt;
                      a!save(ri!DeletedEmployees, append(ri!DeletedEmployees, fv!item.id)),&lt;br /&gt;
                   a!deleteFromDataStoreEntities(&lt;br /&gt;
                    a!entityDataIdentifiers(&lt;br /&gt;
                      entity: cons!DS_ENTITY_REF_EMPLOYEE,&lt;br /&gt;
                      identifiers: ri!DeletedEmployees&lt;br /&gt;
                   )&lt;br /&gt;
                  )&lt;br /&gt;
                    }&lt;br /&gt;
                  )&lt;br /&gt;
                ),&lt;br /&gt;
                size: &amp;quot;ICON&amp;quot;&lt;br /&gt;
              )&lt;br /&gt;
            },&lt;br /&gt;
            id: fv!index&lt;br /&gt;
          )&lt;br /&gt;
        )&lt;br /&gt;
        , &lt;br /&gt;
        addRowlink: a!dynamicLink(&lt;br /&gt;
          label: &amp;quot;Add Employee&amp;quot;,&lt;br /&gt;
          /*&lt;br /&gt;
           * For your use case, set the value to a blank instance of your CDT using&lt;br /&gt;
           * the type constructor, e.g. type!Employee(). Only specify the field&lt;br /&gt;
           * if you want to give it a default value e.g. startDate: today()+1.&lt;br /&gt;
           */&lt;br /&gt;
          value: &amp;#39;type!{urn:com:appian:types}Employee&amp;#39;(),&lt;br /&gt;
          saveInto: {&lt;br /&gt;
            a!save(ri!Employees, append(ri!Employees,save!value))&lt;br /&gt;
          }&lt;br /&gt;
        )&lt;br /&gt;
      )&lt;br /&gt;
    },&lt;br /&gt;
    buttons: a!buttonLayout(&lt;br /&gt;
      primaryButtons: a!buttonWidgetSubmit(&lt;br /&gt;
        label: &amp;quot;Submit&amp;quot;,&lt;br /&gt;
        saveInto:{ a!writeToDataStoreEntity(&lt;br /&gt;
                  dataStoreEntity: cons!DS_ENTITY_REF_EMPLOYEE,&lt;br /&gt;
                  valueToStore: ri!Employees&lt;br /&gt;
                   )&lt;br /&gt;
              }&lt;br /&gt;
      )&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: Editable Grid SAIL</title><link>https://community.appian.com/thread/52218?ContentTypeID=1</link><pubDate>Fri, 02 Feb 2018 12:11:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:006dc040-a443-4b31-a534-55de25705585</guid><dc:creator>sudhakaraa0001</dc:creator><description>After a little investigation, I could get the deletion done using the following syntax. a!deleteFromDataStoreEntities(&lt;br /&gt;
                    a!entityDataIdentifiers(&lt;br /&gt;
                      entity: cons!DS_ENTITY_REF_EMPLOYEE,&lt;br /&gt;
                      identifiers: ri!DeletedEmployees&lt;br /&gt;
                   )&lt;br /&gt;
                  ). I can get the SAIL to do both insert and delete, but, deletes are getting added back as new rows which I am still &lt;br /&gt;
investigating. Moreover, the row.id (primary id) being logged is not the correct one. It seems there is something internal reorganization&lt;br /&gt;
of primary keys that I would have to skim out in order to make the pattern work appropriate. Thanks for your help. I had to use a!entityDataIdentifiers for the deletion to work.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid SAIL</title><link>https://community.appian.com/thread/52216?ContentTypeID=1</link><pubDate>Fri, 02 Feb 2018 12:05:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8067e939-df00-49e1-bec0-6af0c8c6c414</guid><dc:creator>TJ</dc:creator><description>&lt;p&gt;Can you please try replacing your code with this piece of code :&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;a!deleteFromDataStoreEntities(&lt;br /&gt; dataToDelete: {&lt;br /&gt; entity: cons!DS_ENTITY_REF_EMPLOYEE,&lt;br /&gt; identifiers: ri!DeletedEmployees&lt;br /&gt; },&lt;br /&gt; onSuccess: &amp;quot;&amp;quot;,&lt;br /&gt; onError: &amp;quot;&amp;quot;&lt;br /&gt;)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also verify your DeletedEmployees variable type and do check whether it is storing correct value.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid SAIL</title><link>https://community.appian.com/thread/52215?ContentTypeID=1</link><pubDate>Fri, 02 Feb 2018 11:27:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:85b61f22-3d85-4fca-b8ad-b1792612e3c0</guid><dc:creator>sudhakaraa0001</dc:creator><description>How do I use it in DB smart service? I essentially would like my data set bound to the grid with resulting rows after additions/deletions inline to be merged with database table(s). Could you please point me to documentation on this functionality?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid SAIL</title><link>https://community.appian.com/thread/52214?ContentTypeID=1</link><pubDate>Fri, 02 Feb 2018 11:25:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a3c4dd67-fba5-48b8-af1f-ac6f1439bc0c</guid><dc:creator>sudhakaraa0001</dc:creator><description>Editable grid functionality is to read the data from a CDT and allow adds/deletes inline. So, in may case, my grid shows 20 rows having returned from database. I delete one of it. I can submit the transaction to DB first and then add. But, decided to add a new row before hitting submit. I should end up essentially 20 rows in database, and, I should have a new row added and a old row removed. So, in my example, I deleted rowid 56 and added rowid 144 with new information. Hope that explains.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid SAIL</title><link>https://community.appian.com/thread/52213?ContentTypeID=1</link><pubDate>Fri, 02 Feb 2018 11:20:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f2a5bc39-5d1f-4978-9e11-083430369084</guid><dc:creator>TJ</dc:creator><description>Yaa we have merge function available in Appian.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid SAIL</title><link>https://community.appian.com/thread/52212?ContentTypeID=1</link><pubDate>Fri, 02 Feb 2018 11:19:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2e1bcce2-7b3b-438b-a560-4ba904ed550d</guid><dc:creator>TJ</dc:creator><description>I suppose you are not entering data in DB first and directly trying to delete but till the time data is not entered in DB how can we delete that data? Correct me if I am missing anything.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid SAIL</title><link>https://community.appian.com/thread/52211?ContentTypeID=1</link><pubDate>Fri, 02 Feb 2018 11:17:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0c5b57b6-d78b-4b11-a481-0dee973f441b</guid><dc:creator>sudhakaraa0001</dc:creator><description>Is there any merge kind of functionality available? I would like to see my code as lean as possible. Thanks for your help.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid SAIL</title><link>https://community.appian.com/thread/52210?ContentTypeID=1</link><pubDate>Fri, 02 Feb 2018 11:15:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:53bd5b33-10ac-4aa4-996b-c77aa0e0d355</guid><dc:creator>sudhakaraa0001</dc:creator><description>I do have the fv!item.id in grid layout. The id shows up properly for the data set. That is how I could determine fv!item.id -1 as the correct row id to be sent as primary key to be deleted using smart service. In either case, I am most interested in knowing on why error is coming up as &amp;quot; the deletedEmployees&amp;quot; array is empty whereas I do see on the screen my ids in the array.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid SAIL</title><link>https://community.appian.com/thread/52209?ContentTypeID=1</link><pubDate>Fri, 02 Feb 2018 11:10:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7749387d-8087-42b2-8369-f6fa4f6559d2</guid><dc:creator>arjunm922</dc:creator><description>&lt;p&gt;Hey, sorry I didnt check, but I dont think we can not* do both write to data store smart service and Delete from data store smart service in the same interface. Can you try triggering a process using a!startProcess and carry delete/add events there.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid SAIL</title><link>https://community.appian.com/thread/52208?ContentTypeID=1</link><pubDate>Fri, 02 Feb 2018 11:08:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5b5a5d28-a061-44d2-afc8-c2908eefe721</guid><dc:creator>sudhakaraa0001</dc:creator><description>There is a removal link in the SAIL which I thought of making it work. I am also trying to parallel the analogy of how I would have done using dataset merging in other programming languages. Is there any merge CDT that would have merged both inserts and deletes at the same time? I am trying to add one row and delete another row. On submit, I am expecting either one smart service or two, one for inserts and the other deletes, take care of the commits properly. Hope that clarifies.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid SAIL</title><link>https://community.appian.com/thread/52207?ContentTypeID=1</link><pubDate>Fri, 02 Feb 2018 11:05:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1bfe90df-4ecb-46fb-a8f4-d1f63d891e34</guid><dc:creator>arjunm922</dc:creator><description>Hi,&lt;br /&gt;
&lt;br /&gt;
Can you try putting &amp;quot;id&amp;quot; in your gridLayout() as employee.id/fv!item.id. This should store the IDs you want to delete and there shouldnt be a +1 issue.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid SAIL</title><link>https://community.appian.com/thread/52201?ContentTypeID=1</link><pubDate>Fri, 02 Feb 2018 05:40:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8ca8bcd1-621e-4f3f-ab73-443fceff7210</guid><dc:creator>TJ</dc:creator><description>I am not sure whether you want to delete data from database, that has been added previously or you are creating and that time only deleting it. Can you please clear it.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid SAIL</title><link>https://community.appian.com/thread/52198?ContentTypeID=1</link><pubDate>Thu, 01 Feb 2018 20:11:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a4b5950e-8c5d-4c27-b84c-f3b67a52d125</guid><dc:creator>sudhakaraa0001</dc:creator><description>That is what I have in my code. It gets the next rows primary key id. If I change it to a!save(ri!DeletedEmployees, append(ri!DeletedEmployees, fv!item.id -1 )) then I get the correct row primary key id.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid SAIL</title><link>https://community.appian.com/thread/52184?ContentTypeID=1</link><pubDate>Thu, 01 Feb 2018 17:55:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:732ec671-bc97-4b00-b2e6-071504d7c436</guid><dc:creator>Nick Vigilante</dc:creator><description>Can you use save!value instead of fv!item.id here?&lt;br /&gt;
&lt;br /&gt;
a!save(ri!DeletedEmployees, append(ri!DeletedEmployees, fv!item.id))&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>