<?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>Problem in deleting a row in a gridRowLayout</title><link>https://community.appian.com/discussions/f/user-interface/24766/problem-in-deleting-a-row-in-a-gridrowlayout</link><description>Hi, 
 I have a grid row layout and added an remove icon at the end for each row. 
 When I click on remove icon, row is deleting from the UI but it is not deleting from the database. 
 I used the below code for removing the grid row from the UI 
 
 Could</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Problem in deleting a row in a gridRowLayout</title><link>https://community.appian.com/thread/95824?ContentTypeID=1</link><pubDate>Wed, 01 Jun 2022 15:24:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7610182c-3d99-473a-9f64-610f4b4fc5e7</guid><dc:creator>Naresh</dc:creator><description>&lt;p&gt;It is very difficult to understand what you are trying here. In your code your are using ri!index, what is this ri!index? how u get this value? are you trying to delete inside grid? or this deletion logic is outside of grid?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in deleting a row in a gridRowLayout</title><link>https://community.appian.com/thread/95801?ContentTypeID=1</link><pubDate>Wed, 01 Jun 2022 12:00:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:98e04b81-1eb8-4f3a-b7f6-eb032b128981</guid><dc:creator>akhilag7167</dc:creator><description>&lt;p&gt;Hi Naresh,&lt;/p&gt;
&lt;p&gt;Thanks for your response. I have used a!deleteFromDataStoreEntities in interface&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;link: a!dynamicLink(
            value: ri!clickedRow,
            saveInto: {
              a!save(
                ri!data,
                remove(
                  ri!data,
                  ri!index
                )
              ),
			  a!deleteFromDataStoreEntities(
                  dataToDelete: {
                    entity: cons!CDT_Name, identifiers: ri!data[ri!index].Id
                  }
                )
            }
          )&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;But still it is not deleting from database. Could anyone please help me on this&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in deleting a row in a gridRowLayout</title><link>https://community.appian.com/thread/95758?ContentTypeID=1</link><pubDate>Tue, 31 May 2022 17:53:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e20eebe7-2139-4ec9-af8e-4f93a7c8471e</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;FWIW, It&amp;#39;s usually advised not to just delete a DB row like this (especially with &amp;quot;1-click&amp;quot; functionality from which there&amp;#39;s no return); instead, you&amp;#39;d use more of a &amp;quot;deactivate&amp;quot; pattern where you have that row&amp;#39;s dynamic link set a flag, like setting &amp;quot;is active&amp;quot; from TRUE to FALSE, or alternately, an &amp;quot;is deleted&amp;quot; flag from FALSE to TRUE.&amp;nbsp; After the task is submitted, the altered row is written to the DB and your future processing can account for deactivated and/or &amp;quot;soft deleted&amp;quot; rows.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in deleting a row in a gridRowLayout</title><link>https://community.appian.com/thread/95756?ContentTypeID=1</link><pubDate>Tue, 31 May 2022 17:45:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ed3a0ccc-f834-4d2b-a092-1939fa9232fd</guid><dc:creator>Naresh</dc:creator><description>&lt;p&gt;You need to save deleted row PK ids into a rule input and pass those values to process. In your process use delete data store entity smart service to delete those record using those IDs.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can use below logic to save your deleted IDs&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="xml"&gt;link: a!dynamicLink(
  value: ri!clickedRow,
  saveInto: {
    if(
      a!isNullOrEmpty(fv!item.id),
      {},
      a!save(
        ri!deletedIds,
        append(
          ri!deletedIds,
          fv!item.id /*Primary Key of that row*/
        )
      )
    ),
    a!save(
      ri!data,
      remove(
        ri!data,
        ri!index
      )
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>