expression error enumlist & related table

i have a table with 2 columns, "company name"(EnumList) & "Company Key"(text), the user selects "company name" and then "company key" is filled out automatically and the user can't edit it.  
--------------------
when both company name and company key was set to "TEXT" it worked using this formula

SELECT(Company table[Company Key], ([Company Name] = [_THISROW].[Company Name]))
-------------------
I wanted to be able to select multiple "company names" have them separated by a comma, and it still pulls the "company key" and list with a comma. 

i get 2 errors , one on expression assistant 

--Cannot compare Text with List in ([Company Name] = [_THISROW].[Company Name])--

and on the table 

--Column 'Company Key' in Table 'Users table_Schema' of Column Type 'Text' has an invalid expression in the Formula field.'=SELECT(Company table[Company Key], ([Company Name] = [_THISROW].[Company Name]))'. Cannot compare Text with List in ([Company Name] = [_THISROW].[Company Name])--

does anyone have suggestions or even if it is possible to have an EnumList match up with another, I'm trying to be able to create a list of company names and it will pull the company key for each automatically 
0 4 98
4 REPLIES 4

Use IN() instead. 

would it require doing 
IN([Company Name], LIST(Company table[Company Name], Company table[Company Key]))

then a IF() function to return the company key if true? 

I'm able to get the EnumList of company names to list properly with a comma between them
ex:
"Company 01,Company 07,Company 09", now I just need it to auto fill the company key for each with commas too 

No. You should always deal with "Company key" in your expressions and saved values. At the same time, setting "Company Name" as your Label column, will have it shown in all your views. 

For example, you have an EnumList to select companies. The values of this EnumList should be the values of the "Company Key" table, but the display will show you the corresponding values of the "Company Name" column. 

See this:

Row Labels | AppSheet Help Center 

This expression seems to have worked 

SELECT(
Company table[Company Key],
IN([Company Name], [_THISROW].[Company Name])
)

Top Labels in this Space