Use Reference Filters with Conditions

A useful tool for admins, a reference filter points to a reference field—a field in the model’s data object that references a field on another data object. However, because these fields are related to another data object, you may want to limit the selectable options within that filter. You do this using filter conditions—essentially, adding a second layer of filtering to the filter itself.

Note

It’s always important to understand exactly what type of filters your users actually need. Adding conditions to reference filters, while powerful, can also lead to confusing filtering options.

Use Case

Speedy Delivery Company has a customer called Acme Corporation, a firm that creates products for wiley canis latrans and the fast-moving Geococcyx californianus that elude them. Acme has 50+ divisions, each with their own Speedy account. A Speedy sales rep may wish to look at all Acme accounts, and then filter to a specific branch within Acme. However, when that Speedy rep enters Acme into the account filter, Skuid will return 50+ instances of Acme—not a satisfying filter experience.

Putting a condition on the reference filter, so that it only returned Acme accounts that met that condition, allows the rep to locate the specific Acme accounts sought.

Add a Filter Condition to a Reference Filter

Create the filter [[]]

  1. Add a Filter Set to a page

Note

You can also create the filter on Table, Deck, Queue, or other filterable components.

  1. Click fa-plus-circle Add Filter to add a filter to the Filter Set.

  2. Click the filter and then click the Filter Properties tab. Edit:

    • Filter Type: Select either Select Option or Multi-select Option.

    Note

    Reference filters will not work with Date Range, Numeric Range, or Toggle filter types, as these do not reference any field data.

  3. Select the reference field you want to filter by.

  4. Complete the rest of the filter properties as desired.

Add the filter condition [[]]

Note

This option works exactly like lookup filters.

  1. Click fa-plus-circle Add Lookup Filter beside the new filter created in the previous step. This creates a condition on that filter.
  2. Click the newly-created condition and configure your options as needed:
    • Field: select the field you want to use to limit the data in the filter.
    • Operator: select the desired operator.
    • Content: select the type of content to be used as the limiting condition.
    • Value: type in the specific value that must matched.

Clarify the user’s call to action (optional) [[]]

On the filter properties, consider revising the “None Selected” Option Text to make the filter’s focus clearer. For example, rather than filtering “Accounts,” be more specific with “Technology Accounts.”