Select ID when long click on item of a listview that is using a dictionary

I would like to get ID when long click on item of a listview:

What is returning? Did you do “Do it”?

1 Like

What I do is save the data obtained from the dictionary in a variable.

And then you work with that variable (it’s a list)

The position always starts at 0, so to prevent error I add 1. And by adding 1 you get the right data

1 Like

Is not working ? What’s going on in your result?

It give me just the last ID of the listview

But you can simplify: delete by simply taking the index from the list view. There is no need to delete by id, as it is in the long click event.

I need the ID to delete on the mysql table

What is the format of the listview_entrada list ?
Key: Value, Key-Value, Key Value ?

I am setting the list like that

Isn’t it easier to save all the id in a variable and then get the id with the position of the listview?Like my example?

1 Like

I am trying that, I am not so fast, rsrs

It works, thanks @pepocero and @Rogerio_Rios

image

Your example @pepocero it will work.
But, why doesn’t the first block @Miguel_Silva posted work ?

Don’t forget to mark the solution. :+1:

I’m not sure.

Can it be because “position” is always 0?

I dont know. I thought his @Miguel_Silva blocks should work. I don’t know why it didn’t work.
:man_shrugging:
He said It was returning the last ID.

I simplified my job, this is the blokcs are working for me, I am using “position + 2” because on a csv table the first list is the names of columns:
image

I don’t know what to do, but the solution was
@pepocero. Then you changed. And that is another moment. I do not agree with changing the solution. The @pepocero gave you the way with practically ready blocks. Now you have completely changed …
I do not agree with changing the solution. I do not admire these situations where the user questions and after help, says he solved it alone.

1 Like

I agree with @Rogerio_Rios . And it’s not because I want you to mark my answer as a solution, because I don’t care.

It’s because if you’ve arrived to some solution it’s thanks to others who have guided you (In fact, you didn’t notice that the position was always zero until we mentioned it.)

Marking your own answer as a solution doesn’t seem to be the smartest option.

This kind of situation happens a lot in the forum. They come asking something they don’t know and then come up with a solution thanks to an idea given to them by another user and then mark their answer as a solution.

You can keep doing it for me.
I don’t care.
But if you come to ask something in the forum is because you do not know. Or you don’t know how to do it. If you come to a solution is because of the interaction with other users. So the solution is not yours. If it was, you wouldn’t have asked any questions, you would have reached the solution without creating any posts.

1 Like

This is the summary … And I agree …