loading

Linking Entities Together

What You’ll Learn

In this section, you will learn:

  • When to link entities together
  • How to link entities together
  • Important considerations around linking entities

Relating Entities

Part of the power of the Knowledge Graph is relating entities together. This can be done via the Entity List custom field type. Relationships in Yext have 3 properties:

  • The source Entity
  • The pointer Entity
  • The relationship context (the field)

visual description of relating entities

For example, if we wanted to say that Products are available at specific Locations, we could create a field called “Available at” on the Product type. We can use custom field validation to limit what type of entities can be the “pointer Entity”. In this case, we would limit it to just Locations. Once the field is created, we would update each Product entity to point to a location or set of locations on the “Available at” field.

example of relating entities

Once a relationship exists, you can see the relationship contexts and navigate to the Pointer Entities using the Linked Entities Module on Entity Edit. This module will list all relationships organized by Entity Type and Field, including when that entity is either the Source Entity or the Pointer Entity (i.e., another entity is pointing to it). The arrow indicates the relationship direction – if the arrow is pointing to the right, the entity you are on is the Source Entity and is pointing to other entities. If the arrow is pointing to the left, the entity you are on is one of the Pointer Entities and another entity is pointing to it. You can view the count of entities that the entity you are on is related to, or you can click on the field name to view the list of entities related.

Linked Entities Module

Here’s a video showing how we would create this field and update an entity:



Common Use Cases

There are many reasons to want to link entities together. For example:

  • Pull in data from linked entities for Pages (e.g., feature doctor headshots on a facility page or featured menu items on a restaurant page).

  • Relate entities together to answer questions (e.g., “where does Dr. Sara work?” or “what offices have open job positions”)

  • Filter related entity names in Answers (like condition names for Healthcare Professionals for queries like “doctors who treat back pain”)

  • Organize your data for easier management (e.g., bulk editing)


Updating Linked Entity Fields

You can update the linked entity fields just like any other field! You can use the platform for single or bulk edit and we will display an easy-to-search UI for selecting the related entities. You can also use Entity Upload or use the API to update these fields – all you’ll need is the Entity ID (unique identifier) of the related entities.

Important Considerations

While this feature is very powerful, there are a few things to keep in mind when working with Linked Entities:

  • These relationships are one-way (as in are only set from one entity). In most cases, this should be sufficient to pull the data you need

  • You can use Validation to determine what types of entities can be linked (e.g., if you only want users to be able to select the Location type entity). In the video above, you’ll see that we added validation so that only Location-type entities were selectable.

  • You can use Validation on the item count to limit the number of relatable entities (1 to unlimited).

  • For Answers, you can only use the related entity’s name for filters or indexing. You cannot use other related data at this time.

unit Quiz
+20 points
    Error Success Question 1 of 4

    How do you relate entities together?

    Error Success Question 2 of 4

    Are you able to define what types of entities can be selected?

    Error Success Question 3 of 4

    True or False: If you link a Restaurant entity with an Event entity, you can display content from the Event entity on a Restaurant page?

    Error Success Question 4 of 4

    True or False: If you link a Condition entity to a Healthcare Professional entity, you can use the Condition name to filter Healthcare Professionals in Answers (for example, a search for 'doctors that treat condition x')?

    A Hitchhiker in the making! 🔥

    You've already completed this quiz, so you can't earn more points.You completed this quiz in 1 attempt and earned 0 points! Feel free to review your answers and move on when you're ready.
1st attempt
0 incorrect