Click handlers within list views, how to get an id?

Hi all, I have a list view with a delete button within it. I'm trying to trigger a query and pass an id in via additional scope. How can I do this?

The UI looks like this:

And I'm trying to add a click event to that icon that deletes that specific row. I've tried the following scripts:

  additionalScope: {

and even:

  additionalScope: {
    deletedNoteId:[i], // i've heard `i` can be available within lists

neither seem available while i edit nor at runtime. Feedback for retool folks - this seems like a super common case and both these variables should be available in some way honestly.

I assume someone has strategies for making this work since its a pretty common pattern.

Could you tell me more about the structure of your list view? Is it:

  • ListView (new)
    • container
      • button

If so, please try referencing as <yourListVewId>

We are currently working on some scoping bugs, one of which you might be running into right now.

1 Like

Ahhh yea, that's the structure (screenshot if helpful)
Screenshot 2023-12-11 at 1.23.31 PM

And it worked - thanks!