Related Posts
Hey everyone, it’s Danielle with Knack here! I wanted to share a quick Knack tip on how to show multiple fields in your connection dropdowns.
When you’re using connections in your app, those appear as dropdowns in forms. For example, if I want to add an invoice and connect it to a customer, I have a Customer connection field. This displays as a dropdown—but right now, each record only shows one value, typically the Name field.
The Problem: Limited Context in Dropdowns
So here’s the issue: all the connected records appear, but we’re only seeing a single identifier. That can cause confusion—especially when you have non-unique values like two customers with the same name (e.g., two Sarah Joneses). How do you know which is the correct one to choose?
Let’s take a look at this setup in the Builder.
Exploring the Builder: Understanding the Display Field
In our example:
- We have a Customers user role
- We have an Invoices object connected to Customers
- The dropdown is populated from the Customers object
The field that appears in the dropdown is determined by the Display Field in the connected object. In this case, the display field is set to Name.
If we want more context—like showing both the Name and Customer ID—we need to update this display field.
The Solution: Create a Text Formula Field
To show multiple values in a single dropdown option, we’ll use a Text Formula Field to combine fields like name and ID.
Step 1: Add a Text Formula Field
- Go to the Customers object
- Click Add Field and choose Text Formula
- Name it something like
Customer Name + ID
Step 2: Set Up the Formula
We’ll build a formula like:
pgsqlCopyEdit{Name} - {ID}
This will concatenate the name and the ID with a hyphen for clarity.
Note: Text formula fields can do much more than this (e.g., trimming, extracting parts of fields), but for this example, we’re keeping it simple.
Step 3: Set as the Display Field
Once that field is created and calculated:
- Go back to the Customers object
- Set the new Customer Name + ID field as the Display Field
- Save your changes
Testing It in the Live App
Now when you go to add a new Invoice, the Customer dropdown will show entries like:
nginxCopyEditSarah Jones - 12962
Sarah Jones - 98541
You can now visually distinguish between customers with similar names. And if your team has the customer ID handy, they can even search by that ID for faster selection.
This helps reduce errors and makes it easier to ensure you’re updating the right connected record.
Final Thoughts
This technique is especially helpful when values like names or titles aren’t unique. It improves searchability and clarity when connecting records. You can apply this same method across any object connection in Knack
Hope that helps—and until next time, happy building!