Help with Filtered Reference... really struggling in this one

Ok, so I am trying to create this Audit app where I have Internal Auditors, who as company employees, belong to a department.

We don´t want internal auditors auditing their own departments.

So in the audit department, when assigning internal auditors to each department, I want the reference column for auditors to show ONLY auditors that don´t belong to that department.

In theory that should be easy right? Reference Dropdown pointing to Auditor table with rule =choice.department != $Department

(that is, shows only auditors whose department is different than current department. Ps: it doesn´t work with == to show only auditors who belong to that department)

The problem however, is that the Auditors table is made of reference and formula columns only.

The help article uses as a source, a table where you have one column that is a reference (country) and the second column is simply text

But this is my auditores table

First column is a reference to Users table (Users.name). (where I list several users from the company)
Second column just gets the department that user belongs to, from the departamento column in the users table.

Here is the users table
name and email columns are simple text.

Third column has the formula
Departamentos.lookupRecords(email=$id).Departamento

Where it looks Departamento table to see if that person is the Leader of that department.
The other column is a reference so I can just select departments to each user. Thus it shows department user belongs to, even if he/she is not leader/manager.

And finally the Departamentos table

Where I list departments, assign a manager (from the users) to it. I also created a field where it lists all users who belong to that department, trying to make my filtered reference dropdown work.

But it didnt work.

So in the Audit Plan table, I select first the department that will be audited

Notice that not all users are Auditors, so I must select an Auditor from the Auditores table
image

As you can see, from the auditores table, showing the Auditor name, I check the Departamento column in the Auditores table and compare to the selected Departamento I want to audit.

But the drop down is blank
image

as I understand, it should show only Natalia when the formula is == or everyone except Natalia when the formula is !=

Btw, notice I also have types of auditors.

Is it possible to filter by TWO fields? As first auditor, I only want to allow Auditors NOT from that department and Leader Auditors.

Yes, you should be able to filter by multiple fields by using and and or (e.g. choice.Departamento == $Departamento and choice.type == "Auditor")

As for why there is no match, I’ve noticed also that debugging conditions is tricky. One thing to try is this:

  • In the reference column (e.g. “Auditor”), pick a cell that’s not showing an option you expect, say “Natalia”.
  • Remove the dropdown condition temporarily.
  • Set the cell’s value to the option you expect (e.g. “Natalia”)
  • Create another column with the formula that simulates the condition. E.g.
    if the condition was choice.D == $D, add a column with the formula $Auditor.D == $D.
  • It should return true when the value should show up in the dropdown, and false otherwise. Probably you’ll see false, but it’ll be easier to debug why.
  • Once you get this far, you could e.g. create a separate column to show $Auditor.D and compare it to what’s in the column D. Don’t forget to compare both the visible type and the column type.
1 Like

Yes, you should be able to filter by multiple fields by using and and or (e.g. choice.Departamento == $Departamento and choice.type == "Auditor" )

oh… I was trying “AND (choice.Departamento == $Departamento, choice.type == “Auditor”)”

I will try the other tests later.