Filter Drop Down from Ref

Company Contact DropdownCompany Contact DropdownProject DetailsProject Details

I've broken my app before while trying to fix this and I'm too scared to go at it alone again, so I'm bringing this here to you lovely people. 

I want to filter the options available in the Company Contact bar by the Company that owns the project. Both the Company Contacts sheet and the Projects sheet have a column for Company ID, and these values will match prior to using this drop-down.

How can I used this to filter out the employees whose company ID does not match the company who's project I'm assigning staff to?

Thank you, your help is greatly appreciated!

Solved Solved
0 8 305
1 ACCEPTED SOLUTION

FILTER(
 "Company PoC",
 [Company ID] = [_THISROW].[Company ID]
)

View solution in original post

8 REPLIES 8

Thank you, and I've read though these, but my reading comprehension is not the best and I managed to break my app. I do far better with direct examples, so I'm seeking help on a solution. 

Documentation have real world examples made mainly by @Steve
If you don't understand them, take a look at column types and understand each expression's inputs and outputs

Expressions: The Essentials - AppSheet Help
Expression types - AppSheet Help

For what I gathered, this formula should work: 

FILTER("Company PoC", [Company ID] = [Company ID].[ID])

I get the following prompt:

The list of values of column 'Contact ID' from rows of table 'Company PoC'  where this condition is true: ((The value of column 'Company ID') is equal to (The value of 'ID' from the row referenced by 'Company ID'))

Which makes sense because the values of "Company ID" are retrieved from the Company sheet via index matching.  But nothing seems to have changed on my app; the drop down menu is still unfiltered. 

What do you think I should fix?

 

Idk much of your schema, but check the usage of [_THISROW].

The column variables you are using inside a FILTER() expression are those related to the table you mention on the first argument of that expression. But you probably want to check if the [Company ID] is the sames as the one on a column of the table where you are currently, that's where [_THISROW].[Column_with_company_id] is used.

If you tell me the column name of the field that holds the company ID on the view you want to have the dropdown, I can help you a little bit more

Projects Sheet (View)Projects Sheet (View)CompaniesCompaniesCompany ContactsCompany Contacts

Image 1 is the Projects sheet for my main view where all of this is happening; column D is the Company ID. 
Image 2 is the Company Sheer where the ID is established; ID in column A.
Image 3 is the Company Contacts (Company PoC) sheet where the Project View is referencing for the Company Contact Drop down (what I want to filter); ID in column I.

FILTER(
 "Company PoC",
 [Company ID] = [_THISROW].[Company ID]
)

Thank you so much sir! I have a much better understanding of the Filter function thanks to you ๐Ÿ˜

Top Labels in this Space