Matching up a text list with another data type

I’m building an app in which I need to take in a list of strings from an API, match those with a data ‘entry’ in custom data type in my app (which has a value matching the string) and then save those into a list.

I managed to do this originally by splitting up the entire array coming from the API and making them each separate values, then I would search each value to find the right one. This is pretty slow and generally an absolute mess, so I’ve been trying to figure out a way to do this using an array, but i haven’t been able to figure it out yet. Does anybody have a solution to this?

Thanks!