How can I get a dropped item by it's value on a scoreboard?

I have a diamond that is linked to a player via scoreboard, let's say they both have value 2 on an ID scoreboard. Without knowing exactly the player ID, how can I compare it to mevery entity and execute a command at the entity that matches it?

Continue to help post