How to check an entire table for something?

I’m making an police database login, and I have an table that has all the badge id’s and another that has the passwords.

I need to check if the ID they entered matches the badge id, how can I do that?

You can achieve this with table.find inside an if statement.

if table.find(textbox.text, path to your table) then
    print("yes, text entered is inside the table")
end

Thanks, I can finally do the police database.