Understanding and using lookup relationship fields

<body>
<div class="article-banners">
<div id="docs-wmp-link">
<a href="https://support.zendesk.com/hc/en-us/articles/5411234991258-plan" rel="noopener" target="_blank">What's my plan?</a>
</div>

<div class="article-banner" id="suite_all">
<table>
<tbody>
<tr>
<td>
<strong>All Suites</strong>
</td>
<td>Team, Growth, Professional, Enterprise, or Enterprise Plus</td>
</tr>
</tbody>
</table>
</div>

<div class="article-banner" id="support_all">
<table>
<tbody>
<tr>
<td>
<strong>Support</strong>
</td>
<td>Team, Professional, or Enterprise</td>
</tr>
</tbody>
</table>
</div>

</div>

<div class="body">

<p class="p"> A lookup relationship field is a custom field that you can use to establish relationships
between tickets, users, organizations, and <a class="xref" href="https://support.zendesk.com/hc/en-us/articles/5914453843994" target="_blank">custom objects</a>. Additionally, lookup relationship fields can
be used to define relationships between custom objects and articles in Zendesk
Knowledge.</p>
<div class="p">This article contains the following topics:<ul class="ul" id="topic_cq2_zy4_mtb__ul_hkl_dgp_mtb">
<li class="li"><a class="xref" href="#topic_xcn_2gp_mtb">Understanding lookup relationship fields</a></li>
<li class="li"><a class="xref" href="#topic_kmz_wl3_ttb">Adding lookup relationship fields</a></li>
<li class="li"><a class="xref" href="#topic_lzc_235_z5b">Viewing lookup relationships</a></li>
<li class="li"><a class="xref" href="#topic_pgk_llh_vtb">Using lookup relationship fields in triggers and views</a></li>
</ul>
</div>
<p class="p">You can use the Zendesk API to retrieve lookup relationship data. For example, you can
request a list of all tickets related to a specific support manager. To learn more, see
<a class="xref" href="https://developer.zendesk.com/documentation/ticketing/using-the-zendesk-api/retrieving-lookup-relationship-fields-with-the-api/" target="_blank">Retrieving lookup relationship data with the API</a> in the
developer docs.</p>
</div>
<div aria-labelledby="ariaid-title2" class="topic nested1" id="topic_xcn_2gp_mtb">
<h2 class="title topictitle2" id="ariaid-title2">Understanding lookup relationship fields</h2>
<div class="body">
<p class="p">A lookup relationship field is a <a class="xref" href="https://support.zendesk.com/hc/en-us/articles/4408838961562" target="_blank">type of custom field</a> that you can add to users,
organizations, tickets, and custom objects in Zendesk. After adding a lookup
relationship field, team members can use it to establish relationships with other
users, organizations, tickets, custom objects, or in some cases, articles. </p>
<p class="p">You can add a lookup relationship field to ticket forms, user profiles, organization
pages, and custom object schemas. When you do, agents can use this field to look up
and select from a list of users, organizations, tickets, custom object records, or
articles in your Zendesk account.</p>
<p class="p">You can use lookup fields in creative ways that serve your specific business needs.
For example, you could create a lookup field called Manager, tie that lookup field
to your account's users, and add the field to your ticket form. Your agents could
then use this field on a ticket to select a manager from a list of your
organization's users.</p>
<p class="p">If you delete a lookup relationship field, the data in the field isn't preserved. To
preserve the data, deactivate the field rather than deleting it.</p>
<p class="p">Topics covered in this section:</p>
<ul class="ul" id="topic_xcn_2gp_mtb__ul_gkc_fsh_vtb">
<li class="li"><a class="xref" href="#topic_wny_w3k_5tb">Understanding the custom field</a></li>
<li class="li"><a class="xref" href="#topic_g5c_qhk_5tb">Understanding the relationships</a></li>
<li class="li"><a class="xref" href="#topic_zbh_4gp_mtb">Examples</a></li>
</ul>
</div>
<div aria-labelledby="ariaid-title3" class="topic nested2" id="topic_wny_w3k_5tb">
<h3 class="title topictitle3" id="ariaid-title3">Understanding the custom field</h3>
<div class="body">
<p class="p">A lookup relationship field is a custom field that lets you look up and select
from a list of users, organizations, tickets, custom object records, or articles
in your Zendesk account. The following example shows a lookup relationship field
on a ticket. When a team member clicks the field, an auto-populated list of
options is provided as you type in the field. You don't have to define the
options yourself, as you do for other dropdown custom fields, although you can
<a class="xref" href="#topic_t14_w3l_5tb">filter</a> the available
options when defining the field.</p>
<p class="p"><img class="image img-screenshot" id="topic_wny_w3k_5tb__image_rzg_cw3_ttb" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/lookup-relationship-field-example.png" width="450"></p>
<p class="p">After selecting a record in a ticket lookup relationship that points to a custom
object, you can <a class="xref" href="https://support.zendesk.com/hc/en-us/articles/6097369527322" target="_blank">preview the record details within the
ticket</a>.</p>
<p class="p"><img class="image" id="topic_wny_w3k_5tb__image_kfl_ccz_k1c" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/lookup-relationship-field-record-preview-example.png"></p>
<p class="p">After selecting a record in a user, organization, or custom object lookup
relationship field, you can view the record details by clicking the field
name:</p>
<p class="p"><img class="image img-screenshot" id="topic_wny_w3k_5tb__image_o5r_bjh_vtb" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/lookup-relationship-field-name-link.png" width="250"></p>
<p class="p">You can add lookup relationship fields to the following pages in the Zendesk
interface:</p>
<div class="p">
<ul class="ul" id="topic_wny_w3k_5tb__ul_qxr_shk_5tb">
<li class="li">Tickets or the support request form in your help center</li>
<li class="li">The user profile page</li>
<li class="li">The organization page</li>
<li class="li">Custom objects</li>
</ul>
</div>
<p class="p">These pages represent the possible <em class="ph i">source object</em> of a relationship. For
example, a user displayed in the user profile page can be the source object of a
relationship with another user, organization, ticket or custom object. The
lookup relationship field lets you select the other object — also known as the
<em class="ph i">related object</em> — in the relationship.</p>
<p class="p">You can make a lookup relationship field conditional so that it only appears to
agents under certain circumstances. See <a class="xref" href="https://support.zendesk.com/hc/en-us/articles/4408834799770" target="_blank">Creating conditional ticket fields</a> and
<a class="xref" href="https://support.zendesk.com/hc/en-us/articles/6034260247066" target="_blank">Configuring agent access to custom object
records</a>.</p>
</div>
</div>
<div aria-labelledby="ariaid-title4" class="topic nested2" id="topic_g5c_qhk_5tb">
<h3 class="title topictitle3" id="ariaid-title4">Understanding the relationships</h3>
<div class="body">
<p class="p">A lookup relationship can be expressed as follows:</p>
<p class="p"><strong class="ph b">source object</strong> → <strong class="ph b">related object</strong></p>
<p class="p">The source object is the Zendesk object that contains the lookup relationship
field (among other fields). It can be a user, organization, ticket, custom
object, or article. The related object is the object specified by the lookup
relationship field. It can also be a user, organization, ticket, or custom
object. Lookup relationships with <a class="xref" href="https://support.zendesk.com/hc/en-us/articles/4408834725402" target="_blank">legacy custom objects</a> are not
supported.</p>
<p class="p">If you create a relationship between a source ticket and a related user, the
ticket record will have a lookup relationship field identifying the user.
However, the corresponding user record will not have a field identifying the
ticket. Instead of a field, the user record will have a <strong class="ph b">Related</strong> tab
listing the ticket along with all the other source objects it’s related to. </p>
<p class="p">Each source object can be related to only one related object. However, many
source objects can be related to one related object. For example, after adding
an organization lookup relationship field to users, you could then establish
many relationships between users and one organization. Example:</p>
<ul class="ul" id="topic_g5c_qhk_5tb__ul_djg_lk2_5tb">
<li class="li">User 1 - Org A</li>
<li class="li">User 2 - Org A</li>
<li class="li">User 3 - Org A</li>
<li class="li">...</li>
</ul>
<div class="note important">
<span class="importanttitle">Important:</span> This example does not add the user to the organization. It
just establishes a relationship between the user and the organization. </div>
<p class="p">You can view the relationships in ticket forms, user profiles, organization
pages, and custom object record details.</p>
<p class="p">You can also use the Zendesk API to list the users, organizations, tickets, or
custom object records related to a specific related object. For example, you can
request a list of all tickets related to a specific support manager. To learn
more, see <a class="xref" href="https://developer.zendesk.com/documentation/ticketing/using-the-zendesk-api/retrieving-lookup-relationship-fields-with-the-api/" target="_blank">Retrieving lookup relationship data with the
API</a> in the developer docs.</p>
<p class="p">Searching records by lookup relationship field values is not supported. </p>
</div>
</div>
<div aria-labelledby="ariaid-title5" class="topic nested2" id="topic_zbh_4gp_mtb">
<h3 class="title topictitle3" id="ariaid-title5">Examples</h3>
<div class="body">
<p class="p">There are many ways you can use lookup relationship fields to build out complex
relationship ecosystems within Zendesk Support. The following are some examples
to help you start thinking about ways you can use these custom fields:</p>
<ul class="ul" id="topic_zbh_4gp_mtb__ul_vtf_2q1_vtb">
<li class="li">
<p class="p">You're an admin for a trucking company and you want to associate
shippers, drivers, and recipients with tickets. You add three filtered
lookup relationship fields to tickets: a user field named
<em class="ph i">Drivers</em>, an organization field named <em class="ph i">Shippers</em>, and another
organization field named <em class="ph i">Recipients</em>. </p>
</li>
<li class="li">
<p class="p">Your company is in the business-to-business (B2B) space and interacts
with many other companies. You want to track the relationships these
companies have with each other. You decide to use organization lookup
relationship fields to create and track these relationships. For
example, you might have a field named <em class="ph i">Partner</em>, a second named
<em class="ph i">Subsidiary</em>, and a third named <em class="ph i">Competitor</em>.</p>
</li>
<li class="li">
<p class="p">In another business-to-business scenario, each of your account managers
works with a key stakeholder at each of your customer companies. You
create a user lookup relationship field named <em class="ph i">Account Manager</em> to
establish relationships between the stakeholders and your account
managers.</p>
</li>
<li class="li">
<p class="p">You want to designate emergency contacts for members on your team in case
a member is not available. You decide to use a user lookup field named
<em class="ph i">Emergency Contact</em> to create these user-to-user relationships.
In a more complex use case, you could add additional user fields, for
example <em class="ph i">Backup 1</em> and <em class="ph i">Backup 2</em>, to establish a priority of
backups for each person.</p>
</li>
<li class="li">You run an IT desk and want users to select the asset about which they are
submitting a ticket within the ticket form. To accomplish this, you define a
ticket lookup relationship field named <em class="ph i">Related asset</em> that points to a
custom object named <em class="ph i">Asset</em>. The lookup field is configured to filter
results so that only records pertaining to the user are available for
selection, and it's marked as required on the IT ticket form.<div class="note note">
<span class="notetitle">Note:</span> Only
lookup fields pointing to custom objects can be visible to end users.
Furthermore, end users must be signed in to see lookup fields in ticket
forms.</div>
</li>
</ul>
</div>
</div>
</div>
<div aria-labelledby="ariaid-title6" class="topic nested1" id="topic_kmz_wl3_ttb">
<h2 class="title topictitle2" id="ariaid-title6">Adding lookup relationship fields</h2>
<div class="body">
<div class="p">As with other custom fields, lookup relationship fields are displayed on their
object's pages in the Zendesk interface. The number of lookup fields you can create
per object depends on your plan:<ul class="ul" id="topic_kmz_wl3_ttb__ul_tnd_zxn_zgc">
<li class="li">Suite Team and Growth plans can have a maximum of 5 lookup relationship
fields per object.</li>
<li class="li">Suite Professional plans and above can have a maximum of 10 lookup
relationship fields per object. </li>
</ul>
</div>
<p class="p">You can also create lookup relationship fields with the Zendesk API. See <a class="xref" href="https://developer.zendesk.com/api-reference/ticketing/lookup_relationships/lookup_relationships/" target="_blank">Lookup Relationships</a> in the API reference
docs.</p>
<p class="p"><strong class="ph b">To create a lookup relationship field</strong></p>
<div class="p">
<ol class="ol" id="topic_kmz_wl3_ttb__ol_dcn_mm3_ttb">
<li class="li">Start by adding a custom field to your users, organizations, tickets, or
custom object and select <strong class="ph b">Lookup relationship</strong> as the custom field
type. For more information, see:<ul class="ul" id="topic_kmz_wl3_ttb__ul_eld_2xh_ttb">
<li class="li">
<a class="xref" href="https://support.zendesk.com/hc/en-us/articles/4408883152794" target="_blank">Adding custom fields to your
tickets </a> and <a class="xref" href="https://support.zendesk.com/hc/en-us/articles/4408846520858" target="_blank">ticket forms</a>
</li>
<li class="li"><a class="xref" href="https://support.zendesk.com/hc/en-us/articles/4408822051866" target="_blank">Adding custom fields to
users</a></li>
<li class="li"><a class="xref" href="https://support.zendesk.com/hc/en-us/articles/4408842677786" target="_blank">Adding custom fields to
organizations</a></li>
<li class="li"><a class="xref" href="https://support.zendesk.com/hc/en-us/articles/5392409465370-Creating-custom-objects-to-integrate-with-custom-data#topic_cq4_1sn_lwb" target="_blank">Defining a custom object's schema
with custom fields</a></li>
</ul>
<p class="p">Example:</p>
<p class="p"><img class="image img-screenshot" id="topic_kmz_wl3_ttb__image_pbf_ws3_ttb" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/lookup-relationship-field-add.png" width="500">
</p>
</li>
<li class="li">Set the <strong class="ph b">Display name</strong>, <strong class="ph b">Field key</strong>, and <strong class="ph b">Description</strong> as
described in the articles linked from step 1.</li>
<li class="li">Select a related object to list in the lookup relationship field.<p class="p">This can
be a Ticket, User, Organization, Article, or the name of a custom
object. For example, if you select <em class="ph i">User</em> as the related object,
the lookup relationship field will display a list of Zendesk
users.</p>
</li>
<li class="li">(Optional) Click <strong class="ph b">Add filter</strong> to define one or more filters to reduce
the number of options that the field can display.<div class="p">You can filter objects
by any number of tags or custom fields. For more information, see <a class="xref" href="#topic_t14_w3l_5tb">Filtering the field's options</a>.<div class="note note">
<span class="notetitle">Note:</span> Filters aren't
supported for custom object lookup relationship fields with articles
as the related object.</div>
</div>
</li>
<li class="li">Click <strong class="ph b">Save</strong>.</li>
</ol>
</div>
</div>
<div aria-labelledby="ariaid-title7" class="topic nested2" id="topic_t14_w3l_5tb">
<h3 class="title topictitle3" id="ariaid-title7">Filtering the field's options</h3>
<div class="body">
<p class="p">Your account could have thousands or even millions of ticket, user, organization,
and custom object records. In most cases, you'll want a defined subset of
records for the options in your lookup relationship fields. For example, you
might want to list only users who are account managers.</p>
<p class="p">All lookup relationship fields that target standard objects can filter the
records of the related object by tag. For example, to list only users who are
account managers, you could add an "account_manager" tag to the user profiles of
your account managers and then define the following filter condition for the
lookup relationship field: <code class="ph codeph">Tags | Contain at least one of the following
| account_manager</code>. This isn't possible for lookup fields that
target custom objects.</p>
<div class="p">Depending on the object the lookup field is defined on and the object it targets,
different filters are available to help admins restrict the records available to
be selected within the field.<ul class="ul" id="topic_t14_w3l_5tb__ul_tqz_g5f_l1c">
<li class="li">Lookup fields that target tickets have the following additional default
filters are available: Status, Type, Priority, Assignee, Requester,
Form, Organization, and Channel.</li>
<li class="li">Lookup fields that target users have an additional Role filter
available.</li>
<li class="li">Ticket lookup relationship fields that target other objects can
dynamically restrict the object records available for selection within
the lookup field by using additional filters based on the ticket's
current user, assignee, requester, and organization.</li>
</ul>
</div>
<p class="p">Lookup relationship fields also support filtering by other custom fields added to
the related object. For example, if you add a <em class="ph i">Security Clearance</em> custom
checkbox field to the user profile, the <em class="ph i">Security Clearance</em> field will
appear as a filter option when you add the lookup relationship field. You could
then define the following filter condition for the field: <code class="ph codeph">Security
Clearance | Is | Checked</code>. </p>
<div class="p">Furthermore, you can filter lookup relationship fields based on whether they
match or don't match field values in the source object. For example, if a ticket
has a lookup relationship field named <em class="ph i">Product category</em> that points to a
custom object named <em class="ph i">Product</em>, you could filter the results to return only
<em class="ph i">Product</em> records that have a <em class="ph i">Category</em> field value that matches
the ticket's <em class="ph i">Product category</em> field. When filtering lookup relationship
fields for matching values in one of the source object's fields, the tags
(rather than values) are compared for drop-down fields and if comparing lookup
fields, they must have the same target object.<div class="note note">
<span class="notetitle">Note:</span> When using the
<code class="ph codeph">match</code> and <code class="ph codeph">does not match</code> operators to
filter lookup field values, you can only compare values in fields of the
same type. For example, two drop-down field values can be compared, but you
can't compare a drop-down field's value to a multi-select field's value.
Therefore these operators are only available when matching field types
exist.</div>
</div>
<p class="p">You can modify the filters at any time. This won't affect the values previously
selected within lookup relationship fields.</p>
<p class="p">To learn more, see <a class="xref" href="https://support.zendesk.com/hc/en-us/articles/4408838961562" target="_blank">About custom fields</a> and <a class="xref" href="https://support.zendesk.com/hc/en-us/articles/4408893545882#topic_i3y_fkz_1cb" target="_blank">Building trigger condition
statements</a>.</p>
</div>
</div>
</div>
<div aria-labelledby="ariaid-title8" class="topic nested1" id="topic_lzc_235_z5b">
<h2 class="title topictitle2" id="ariaid-title8">Viewing lookup relationships</h2>
<div class="body">
<p class="p">Establishing relationships between records is important for building out your complex
data model. However, it's also important to see and interact with those
relationships within Zendesk. Each user profile, organization, and custom object
record displays a list of related records. For tickets, any related records are
visible as values within the ticket fields.</p>
<p class="p">Clicking on lookup relationship fields opens the related record's details in a new
tab in Support.</p>
<div class="note note">
<span class="notetitle">Note:</span> <a class="xref" href="https://support.zendesk.com/hc/en-us/articles/4408887617050" target="_blank">Archived tickets</a> aren't included in lists
of related records.</div>
</div>
<div aria-labelledby="ariaid-title9" class="topic nested2" id="topic_i11_lxx_ryb">
<h3 class="title topictitle3" id="ariaid-title9">Viewing records related to users and organizations</h3>
<div class="body">
<p class="p" dir="ltr">Each Zendesk Support profile for a <a class="xref" href="https://support.zendesk.com/hc/en-us/articles/4408835022490-Viewing-and-editing-your-user-profile-in-Zendesk-Support" target="_blank">team member</a>, <a class="xref" href="https://support.zendesk.com/hc/en-us/articles/4408822762650" target="_blank">end user</a>, or <a class="xref" href="https://support.zendesk.com/hc/en-us/articles/4408846640410#topic_rqt_442_vlb" target="_blank">organization</a> includes a <strong class="ph b">Related
</strong>tab that lists all related source objects. The information is grouped by the
type of source object (<strong class="ph b">Tickets</strong>, <strong class="ph b">Organizations</strong>, <strong class="ph b">Users</strong>, or
<strong class="ph b">Custom objects</strong>) and the specific lookup field.</p>
<p class="p" dir="ltr">In the following example of a team member profile, tickets have a
lookup relationship field called <em class="ph i">Driver</em>. If Annie Porter is selected in
the <em class="ph i">Driver </em>field, that ticket appears under the <strong class="ph b">Related</strong> tab on her
team member profile. It’s grouped by the type of source object, <strong class="ph b">Tickets</strong>,
and the name of the lookup field, <em class="ph i">Driver</em>. </p>
<p class="p"><img class="image img-screenshot" id="topic_i11_lxx_ryb__image_rgm_p35_z5b" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/related_tab_user_profile.png" width="600"></p>
<p class="p">The <strong class="ph b">Related</strong> tab doesn’t appear on <a class="xref" href="https://support.zendesk.com/hc/en-us/articles/4408835078810" target="_blank">user profiles in your help center</a>.</p>
</div>
</div>
<div aria-labelledby="ariaid-title10" class="topic nested2" id="topic_ejy_mxx_ryb">
<h3 class="title topictitle3" id="ariaid-title10">Viewing records related to tickets</h3>
<div class="body">
<p class="p">Within a ticket, lookup relationship fields are displayed like any other fields
in the ticket field panel. </p>
<p class="p">For lookup fields pointing to organizations, users, or other tickets, clicking on
the field opens the record in a new tab in Support. If the lookup field points
to a custom object, you can view the record's details within the context panel
without navigating away from the ticket you're working on. See <a class="xref" href="https://support.zendesk.com/hc/en-us/articles/6097369527322" target="_blank">Interacting with related object records in
tickets</a>.</p>
</div>
</div>
<div aria-labelledby="ariaid-title11" class="topic nested2" id="topic_mqc_ywx_ryb">
<h3 class="title topictitle3" id="ariaid-title11">Viewing records related to custom objects</h3>
<div class="body">
<p class="p">Similar to users and organizations, when you view a custom object record's
details, you'll see all values for all of the object's fields on the left and
then a list of related records grouped by the source object's type on the right. </p>
<div class="p">When viewing the list of related records, the source object's type is indicated
by one of the following icons, the source object's name, and then the lookup
relationship field's name is in bold and parentheses.
<div class="tablenoborder">
<table border="1" cellpadding="4" cellspacing="0" class="table" frame="border" id="topic_mqc_ywx_ryb__table_btb_2wy_ryb" rules="all" summary="">
<colgroup>
<col>
<col>
</colgroup>
<thead class="thead" style="text-align:left;">
<tr class="row">
<th class="entry cellrowborder" id="d52e671" style="text-align:left;vertical-align:top;">Icon</th>
<th class="entry cellrowborder" id="d52e674" style="text-align:left;vertical-align:top;">Source object</th>
</tr>
</thead>
<tbody class="tbody">
<tr class="row">
<td class="entry cellrowborder" headers="d52e671" style="text-align:left;vertical-align:top;"><img class="image" id="topic_mqc_ywx_ryb__image_llp_p3d_nwb" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/icon_related_custom_object_record.png" width="16"></td>
<td class="entry cellrowborder" headers="d52e674" style="text-align:left;vertical-align:top;">Custom object</td>
</tr>
<tr class="row">
<td class="entry cellrowborder" headers="d52e671" style="text-align:left;vertical-align:top;"><img class="image" id="topic_mqc_ywx_ryb__image_qft_lzx_ryb" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/icon_related_org_record.png" width="16"></td>
<td class="entry cellrowborder" headers="d52e674" style="text-align:left;vertical-align:top;">Organization</td>
</tr>
<tr class="row">
<td class="entry cellrowborder" headers="d52e671" style="text-align:left;vertical-align:top;"><img class="image" id="topic_mqc_ywx_ryb__image_jhq_nzx_ryb" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/icon_related_user_record.png" width="16"></td>
<td class="entry cellrowborder" headers="d52e674" style="text-align:left;vertical-align:top;">User</td>
</tr>
<tr class="row">
<td class="entry cellrowborder" headers="d52e671" style="text-align:left;vertical-align:top;"><img class="image" id="topic_mqc_ywx_ryb__image_jpm_jgz_ryb" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/icon_related_ticket_records.png" width="18"></td>
<td class="entry cellrowborder" headers="d52e674" style="text-align:left;vertical-align:top;">Ticket</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="p">
<div class="note note">
<span class="notetitle">Note:</span> Related articles aren't reflected in the related records list. Instead,
the related article value is visible only within the record's field and
functions as a hyperlink to the article.</div>
</div>
<p class="p">The following example shows the details for record <em class="ph i">256</em> of the
<em class="ph i">Project</em> custom object. In addition to the specific details about
project 256, you can also see that this project is related to 3 tickets via a
lookup relationship field on the ticket (<img class="image" id="topic_mqc_ywx_ryb__image_vcf_v3y_ryb" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/icon_custom_object_related_ticket_records.png">) named <em class="ph i">Project Code</em> that points to the
<em class="ph i">Project</em> object. </p>
<p class="p"><img class="image" id="topic_mqc_ywx_ryb__image_y3x_k1y_ryb" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/custom_object_related_records.png" width="600"></p>
</div>
</div>
</div>
<div aria-labelledby="ariaid-title12" class="topic nested1" id="topic_pgk_llh_vtb">
<h2 class="title topictitle2" id="ariaid-title12">Using lookup relationship fields in triggers and views</h2>
<div class="body">
<p class="p">You can use lookup relationship fields to help define <a class="xref" href="https://support.zendesk.com/hc/en-us/articles/4408822236058" target="_blank">triggers</a> and <a class="xref" href="https://support.zendesk.com/hc/en-us/articles/4408888828570" target="_blank">views</a>. </p>
<p class="p">When adding a condition to a trigger or view, any lookup relationship fields also
appear in the list of options. In the following example, the first condition of a
trigger is a user lookup relationship field named <em class="ph i">Support Manager</em>. The
trigger will only fire for tickets associated with the support manager named
Jennifer Hanson.</p>
<p class="p"><img class="image img-screenshot" id="topic_pgk_llh_vtb__image_o1c_brh_vtb" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/lookup-relationship-field-condition.png" width="500"></p>
<p class="p">You can also use lookup relationship fields in the actions of your triggers. In the
following example, the action sets the value of the organization lookup relationship
field named <em class="ph i">Company Organization</em> to Northwest Region when the trigger fires. </p>
<p class="p"><img class="image img-screenshot" id="topic_pgk_llh_vtb__image_ed3_drh_vtb" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/lookup-relationship-field-action.png" width="500"></p>
<p class="p">In addition to using the record name specified in lookup fields in trigger conditions
and actions, you can also reference the related record's fields within your
conditions and actions. For example, if you have a ticket lookup relationship field
named <em class="ph i">Software requested</em> that points to a custom object named
<em class="ph i">Software</em>, you could use the Software requested lookup field to create
conditions and actions around the record selected within the lookup field—as in a
record is or isn't present, or the record's name is or isn't set to a specific
value—or you can reference other fields within the record, such as a <em class="ph i">Approval
required</em> checkbox being selected or not within the record related to the
ticket. For more information about using lookup relationship fields that target
custom objects in triggers, see <a class="xref" href="https://support.zendesk.com/hc/en-us/articles/5928347565082" target="_blank">Using custom objects in triggers</a>.</p>
<p class="p">You can also use <a class="xref" href="https://support.zendesk.com/hc/en-us/articles/4408886858138" target="_blank">placeholders</a> to retrieve information about the target
record in a lookup relationship field. This is true for lookup fields pointing to
other tickets, users (requester), and organizations. The ID can then be used in API
requests, such as to assign the ticket to the user specified in a lookup field or
notify the manager of the user specified in a lookup field that their approval is
required.</p>
</div>
</div>
</body>