Reference lookup issue: what's in a name? Not much . . .

  • 2
  • Problem
  • Updated 6 years ago
Archived and Closed

This conversation is no longer open for comments or replies and is no longer visible to community members. The community moderator provided the following reason for archiving: Old Questions

My apologies in advance if you've addressed this issue. I did a quick check and did not find this addressed.

We've got lots of Companies that go by the same name because we have company records for each office location. Consequently, we tell the companies apart using the Site field, which describes the unique location So unique identifier for imports = Company name + Site.

Depending on the the person's name, we can have lots of Contacts with identical names. i.e. John Smith.

So whenever there is more than one name returned by your very cool auto-lookup, what definitely won't work is being ask to pick between identical choices. On the Account record, we need to see other stuff like Site to determine whether the company is the right company record. For people, we need to other stuff like title, and where the person works.

So, we need the lookup to work the way, for example, the Account lookup works on the Contact object. It brings us to a view of the search results from which we can select the right record.

Is there a way to have both the type-as-you-go auto-lookup with a click-on-magnifying glass icon option so that when there's more than one identical result, we can simply pull the results into view to make the right choice?
Photo of krista06880


  • 816 Points 500 badge 2x thumb

Posted 6 years ago

  • 2
Photo of Greg Huete

Greg Huete

  • 2,340 Points 2k badge 2x thumb
I don't know if this helps, but you should be able to use a table's search box as your search field.

By using an account model without conditions, when you search the table, it will filter down all results in that object, and you can specify the columns to see on the table.

At that point, maybe a row action or something could be the magnifying glass you are looking for. Just a thought!


I just realized you're looking for this functionality most likely inside another table or for a field in a field editor. That might not help - but I'll leave it there in case it sparks an idea for you :)

Practically, maybe you could name each company name Electronic Arts - UT Salt Lake, etc, and then use the parent account field / hierarchy Salesforce feature for referencing the company name without the location. That way, for now at least, you could at least tell which location you're choosing.
Photo of krista06880


  • 816 Points 500 badge 2x thumb
I'm looking for this on the reference fields on the detail pages. It's a pretty basic need: anytime you have a reference field that links one record to another, you will encounter this issue whenever there are duplicate values.

I believe Salesforce enables you to configure a view in setup for this exact purpose. The example I've shown you is the Account (Company) reference field on the Contact Detail page in the existing Salesforce UI. When you edit the Contact record, you get a little magnifying glass to look up the right Account (Company) in your database.

The results are returned in a table view as above. You then select the right Account record to which you will link the Contact record.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 45,188 Points 20k badge 2x thumb
There are also a way to extend the data provided in the autocomplete field that comes standard with reference fields in tables and field sets. These fields have a few extra tabs in the properties section.

In advanced section you can specify a Display Template that concatenates multiple fields from the referenced object. In the case below I've added a "City and State" to the Account name so that you could distinguish between various "ACME" companies in your account lookup.

So in the resulting page you can distinguish your values in the autocomplete drop downs:

Photo of krista06880


  • 816 Points 500 badge 2x thumb
Also, come to think of it, there is not way to resolve this in a table as you suggest (even if you did it in a cool queue page). You need to do a lookup to connect one record to another. You go in through the reference field and select the specific record to which you will link another record. When there are no fields other than Name to see, it becomes a frustrating guessing game when you are given two or twenty identical choices. We'd have to connect the records and then see if that's the right one after connecting them. Imagine doing that 20 times in a row as you make your way through a few dozen identical company names.

We keep company names identical to keep data need and tidy for mail merges and to find people who work at the same company, no matter what the location. Contacts are attached to the Company record/office location where they are based. This enables us to keep all office addresses on Contact records clean as well . . .with mass update if needed. Contacts created off the Company record automatically get the right address. . . at least, that's why we do what we do.

Given your current look up we would be forced to append the location to the company name field, which would definitely not be a "best practice".
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 45,188 Points 20k badge 2x thumb
An important detail came to mind as I was riding my bike home from work. (It usually works that way...)

In order for the additional fields to show up when you select the little boxes next to the display template field, and for them to show in the autocomplete drop down - they have to be in your model. Just follow the link to the related object and choose the other fields you want to use in your model.

Hope this solution works for you..
Photo of Zach McElrath

Zach McElrath, Employee

  • 55,248 Points 50k badge 2x thumb
Rob's approach will solve your issue, Krista --- if you want to be able to search on both Account Name and Site when doing an Account lookup from a Contacts table, all you have to do is 2 things:

(1) Go to your Contacts Model, and add Account.Site into your fields.

(2) Customize the Fields that your Autocomplete searches on, and the format of the fields returned for your users to see by the autocomplete, by editing the AccountId field in your Contacts Table, and going to the "Advanced" Properties

The "Display Template" determines the format of the results returned by your Autocomplete. For instance, a Display Template of "{{Name}} ({{Site}})" would return results looking like this:

Acme Industrial Corp (Toronto)
United Oil & Gas (Singapore)

Skuid will search on all fields referenced in your Display Template --- so, here, Skuid would search on both Name and Site.

*** I recommend checking the "Tokenize autocomplete search" box. This will make it so that if you type multiple words into the search box, Skuid will search on each word separately. e.g. if you type "Acme Toronto", rather than Skuid requiring that there be an Account whose Name or Site contains "Acme Toronto", it will instead search separately on each word, so that it will find accounts whose Name contains "Acme" or "Toronto" and whose Site contains "Acme" or "Toronto". That way, if you have an Account named "Acme Industrial" whose Site is "Toronto", that Account will be returned in the Autocomplete search.
Photo of krista06880


  • 816 Points 500 badge 2x thumb
A related question . . . We create new Contact records from Account records by clicking on the New Contact button.

We do that so that the address information is copied over to the Contact address field. How would we do that in Skuid?

This conversation is no longer open for comments or replies.