Delete a row after confirmation

Hi.

I have a variable, RowToDelete, with value = thisrow().
I try to delete the row using an automation specified row delete step, with delete row =FILTER(RiepilogoMensile,"RiepilogoMensile=$[RowToDelete]"), but nothing are deleted.

Could you help me ? Thanx

Hi @Seveweb, thanks for your post!

We may need a bit more info in how your automation is set up, but let me see if this helps you -

It looks like you may be wanting to just delete the context row. If that's the case, in the delete row action of your automation, you can simply select for the context row to be deleted as shown here:

Screen Shot 2020-08-17 at 6.31.54 AM

With this, you'll also want to ensure that the button or trigger source has correct input source. You can check this in Builder by selecting the block that the button is located in, and in the properties window, clicking on the "Data" tab to see the source.

Otherwise if you choose to write out the specified row, I would suggest to use FindRow() to specify a particular row to delete, rather than filter in this case.

Let me know if this helps. If you are still having trouble, please provide us with more info on how your automation and screen is set up (perhaps with screenshots).

Hi.
I try to explain better.

I've a list and I'd like to ask confirmation before to delete a single row:

  • I put a data-cell named "RowToDelete" on the form but out of the list
  • I put a button on the segment of the row; when I click the button, I set RowToDelete equal to THISROW()
  • I've two button "YES" and "NO" with visibility set to: =IF($[RowToDelete]=0,FALSE,TRUE)
  • button "YES" have an action with "Delete the specified row " set to =FILTER(RiepilogoMensile,"RiepilogoMensile=$[RowToDelete]")

Thanx

Hi @Seveweb,

Got it, I understand what you're trying to do :slight_smile:

For the field to specify the row to delete, you can simply put =$[RowToDelete] since you are already setting it to equal the row in the list with ThisRow().

Here's an example screen I built that does what you'd like to achieve.

This is how it's set up:

This screen has a list, and in the list I added a button (the X button) which a user would click to see the confirmation message.

Below the list is a new segment where I added two data cells, one to store true or false if the delete confirmation is visible or not (which is called $[ShowConfirmDelete]), and one for the row to delete (which is called $[RowToDelete]).

I set $[ShowConfirmDelete] to =FALSE for the initial value. And I did not set any initial value for the $[RowToDelete].

I also added a content box with the delete confirmation message and two buttons (Yes and No buttons), each have their visibility set to the =$[ShowConfirmDelete] variable.

For the X button's automation, I update the delete confirmation value to true and also pass in the value of the row with ThisRow() to the row to delete variable:

Now when the user clicks on that X, they will see the delete confirmation message and the confirm or cancel buttons.

For the 'Yes, Delete' button, I put =$[RowToDelete] in the specified row field in the automation.

Screen Shot 2020-08-20 at 12.37.12 PM

And have it then update the screen to hide the confirmation message again. (Set value to false)

For the 'No, Cancel' button, the only action added was to hide the confirmation message.

Now when you try this app, you can click on the delete button in any row in the list, and be brought to a confirmation message where you can confirm or cancel the deletion of that row.

I hope this example helps. :slight_smile: :honeybee:

1 Like

Hi.

Thank you for your explanation.

Now, it worked ... I was making a "little mistake":
I used a function to delete the row instead of using the RowToDelete variable directly.

1 Like

Hi @Seveweb,

Great, I'm happy that helped and that you got it to work now! :slight_smile:

Feel free to reach out again if you have any other questions in the future.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.