Best way to normalize db data from a dropdown?

I have a dropdown which includes 180 or so countries. Currently it’s saving “United States” for example, as “United States” in the db. Of course, for database normalization reasons, I’d rather have it saved as 1-180, corresponding to each country. What might be the easiest way to do this? Thank you.

Hi there, @mark24… what is the data source for your dropdown? If it’s an option set, you could add an attribute to the option set and save the attribute’s value (which would be the code associated with each country) to the database when an option is selected.

Best…
Mike

Hi mikeloc, thanks for the reply.
“Static choices”. To be clear, I include a screenshot.

Don’t use static choices…

Use the actual data (DB or Option Set)

I definitely wasn’t expecting it to be static choices. There really isn’t a good way to do what you are trying to do with static choices, so you should use an option set or a custom data type so you can define an alternate value (as an attribute in an option set or as a field in a custom data type) to save when an option is selected.

Oh, and if your next question is how can you get all of those options/attributes into an option set, it won’t hurt to give this extension a look.