Delete same multiple in dynamic component

I have made a list and shown dynamic label in the dynamic cardview

List:-
Mango
Banana
Pineapple
Mango
Lichi

So as you can see there are 2 mangoes in the list.
I want that if any of the mango cardview clicked then if more than 1 mango containing item got deleted. So here both mango should be deleted.
How can I do this.

I tried it but was getting error. I was using each item block.

What was the error?
It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select “Download Blocks as Image”. You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun

Then before making the dynamic list better filter the list then create dynamic components.

else on button click get the id and delete the clicked dynamic id alone


I added same item twice and on removing one it gives this error

But I want that, suppose the clicked id text is mango, than other mango written text should also be deleted.

Option 1 Then use your main list for this purpose. When component is clicked first get index, using this index take the clicked item from the global list, then find the duplicate items index numbers then by using this number del the ids.

Option 2 get index of the clicked card, get tge text of the item to be checked, the loop from 1 to total length of cardview id,
If the clicked item matches with loop item get text
Then delete the card view id
Else do nothing

Option 1 can be achieved easily by using an extension with limited blocks. ListNinja extension can be used to find the index places of duplicate items quickly