How to access index in a listView?

So I have this icon in a listView, I want to trigger a (javascript) query when I press it. But how can I attach data to that query? I need to know what comment to delete when I press the icon

Screenshot 2022-08-16 at 21.51.34

@benjick
Can you share the inspect view of the listView component?

Hey @ScottR, and thanks for replying

Here's the inspect panel:

In your query you can access it with the "magic" i variable which acts like a pseudo index in the list view - so in your query you should be able to get to the record data with this, if you trigger the query from the click event of the icon:
{{get_comments.data[i]}}

1 Like

Thanks! That worked great :pray:

1 Like