Boost recurring donations this giving season with the new upsell prompt!Learn How >>

Displaying Name instead of ID for reference field value


In Salesforce, when one object is related to one another, the field that contains the value that points to the related record in the related object is called a reference field. In other database systems, a reference field is called a foreign key.

This reference field contains a string of characters that is the unique identifier for the record it is referencing. That record, in turn, has a Name field.

If you include a reference field on the List Display or Record Display view of a Directories page, it will display the Name of the related record rather than the unique identified.

As an example, if you have a Directories page which is displaying records from the Contact object in your Salesforce account, if you include the standard field AccountId from the Salesforce Element drop down, it will display the Organization / Account name rather than the unique identifier.

This is the actual value contained in the Account ID field in Salesforce:


Soapbox replaces the actual value with the Name of the related record:


Searching on an Id field

While Soapbox automatically replaces the Id value with the Name of a related record on List Display and Record Display views, when a reference field is included on the Search Form, the literal Id of a matching record must be used to successfully search. As an example, if your Directory is displaying data from the Contact object and you wish to search on the Account Id field, you must use the record Id for a matching Account (e.g., 001xxxxx...) rather than the Account Name (e.g., "MyOrg"). If you attempt to search using something other than the Id itself, the following error message will be returned:

0 - Error retrieving results

Given this, the most common use case for searching directly on a reference Id would be in instances where a Soapbox Engage instance has our user integration feature, and the reference field is hidden and autopopulated based on a logged in user's Contact or Account information.

For further details on this use case, see Filter results by logged in user's Contact record or Account record. If you wish to learn more about our user integration feature, click here.

If you wish to search on the Name of a related record rather than the Id contained in the reference field, we recommend creating a Salesforce formula field on the main object of your Directories form that pulls the Name from the related record. You can then include this field as the search field to search on the Name itself.

Have more questions? Submit a request
Article is closed for comments.