The Knowledge Graph supports a variety of field types, each designed for different kinds of data.
Standard Field Types
Each field is defined by a type. These are the standard field types available in the Yext platform.
| Type | Description | Available Validation |
|---|---|---|
| Call-to-Action | Call to Action with label and link | Label character length (up to 255), Link character length (up to 2,000) |
| Complex Photo | Photo with built-in caption, details, clickthrough URL & alternate text | Aspect Ratio, Min Width/Height |
| Complex Photo Gallery | Gallery of Photos with built-in caption, details, clickthrough URL & alternate text | Aspect Ratio, Min Width/Height, Item count (up to 500) |
| Complex Video | YouTube (and YouTube Shorts) URL with built-in description | Description character length (up to 140) |
| Complex Video Gallery | Gallery of YouTube URLs with built-in description | Description character length (up to 140), Item count (up to 100) |
| Daily Times | Daily times field | n/a |
| Date | Date field | Date Range |
| Date + Time | Date field with specified time of day | Date and Time Range |
| Entity Relationship | List of related entities with the option to select a One Way, Two Way (Shared Field), or Two Way (Distinct Field) relationship type | Selectable Entity Types, Item Count (up to 5,000) |
| File | File field types can be configured to support one file or support a list of files. | File Format and Maximum File Size (up to 1GB) |
| Hours | Daily Hours field | n/a |
| Multi-Line Text | Long-form text | Character length (up to 100,000) |
| Multi-Option Select | Option field where user can select multiple options | Available Options, Item count (up to 2,000) |
| Number | Numeric field | Number Range |
| Phone | Numeric field with country code prefix and automatic phone number formatting | n/a (validation on what constitutes a valid phone number is derived from Google ) |
| Photo | Photo with alternate text | Aspect Ratio, Min Width/Height |
| Photo Gallery | Gallery of Photos with alternate text | Aspect Ratio, Min Width/Height, Item count (up to 500) |
| Price | Price Field | n/a |
| Rich Text | Rich text field with formatting | Type of formatting (bold, italics, underline, bulleted list, numbered list, hyperlink, code block), Character length (up to 100,000) |
| Single-Line Text | Short-form text | Character length (up to 100,000) |
| Single-Option Select | Option field where user can select only one option | Available Options |
| Slug | A short, reader-friendly label at the end of a URL that typically acts as an identifier, e.g., hitchhikers.yext.com/docs | Lowercase alpha-numerics and the following special characters: - . _ ~ : / [ ] @ ! $ ’ ( ) * + ; = “ |
| Text-List | List of text strings | Character length (up to 100,000), Item count (up to 1,000) |
| Time | An hour and minute value (hh:mm) |
n/a |
| URL | Website URL | Character length (up to 2,000) |
| Video | YouTube (and YouTube Shorts) URL | n/a |
| Video Gallery | Gallery of YouTube (and YouTube Shorts) URLs | Aspect Ratio, Min Width/Height, Item count (up to 100) |
| Yes / No | Field with options Yes, No, or Unspecified | n/a |
File Field Type
The File field type allows you to store files directly on your entities. This type is available for use in custom fields and custom field types.
Properties
The File field type is composed of the following five properties:
| Property | Description |
|---|---|
sourceURL |
Source URL of the file. Only populates if uploaded by providing a hosted URL. |
url |
The Yext-Hosted URL of the file. |
mimeType |
The MIME Type of the file. Currently, all MIME types are supported. |
name |
The display name of the file. User-settable. Note: The name property cannot be mapped via connctor, but can be set or edited on all other interfaces.the | |
size |
The size of the file in bytes. |
File field types can be configured to support one file or support a list of files. This will automatically create a maximum file upload validation of 1 or 5,000 respectively.
Validation
The default validation for File fields is below. You can also configure validation for File custom fields and File custom field types.
| Option | Default Validation | Custom Validation |
|---|---|---|
| File Format | All MIME-type formats are allowed. | You can restrict uploaded files to a subset of allowed file types by common MIME type. |
| Maximum File Size | Files cannot exceed 1 GB. | Set a different maximum size limit in bytes, kilobytes, or megabytes. The value must be a whole number. |
Note: There is a known issue with JsonFormat.Printer affecting Configuration as Code where the maxSize property will be returned as a string when pulled. However, when applied, this property needs to be a number.
Uploading Files
Files can be uploaded using all interfaces for editing entities in the Knowledge Graph (i.e., Entity Edit, Entity Upload, Connectors, API, and CaC).
All interfaces support file uploads by referencing a source URL. Uploading from a local file system is only supported in Entity Edit.
To upload a file that is hosted online, indicate the hosted URL using the url property. This provided url will then be propagated to the sourceUrl property, while the URL field will change to be the Yext hosted URL of this file.
Updating Files
To change a file being stored in a field on an entity, update the value of the url property to be the new hosted file’s URL. Sending updates to the sourceUrl property is not supported.
The user-agent string used to download files is YextBot YextFileDownloader/1.0.
Accessing Stored Files
Files stored on entities can be accessed via Entity Edit and via API.
Entity Edit
Files can be downloaded from the URL property. The edit state of this field will show all properties of the File field. Properties of a file cannot be edited in Entity Edit, except for the name of the file.
API
Opening the URL stored in the url property will download the file onto your local device. Here’s an example of what this would look like on an Entities: GET.
With other fields elided, the response looks like this:
{
"response": {
"entities": [{
"c_pdfFile": [{
"sourceUrl": "https://www.pdfs.com/123",
"url":"https://a.mktgcdn.com/f/3912636/123",
"mimeType": "application/pdf",
"name": "Instruction Manual",
"size": 2001
}]
}]
}
}
Photo Field Type
The Photo field type allows you to store photos directly on your entities. This type is available for use in custom fields and custom field types.
Properties
The Photo field type is composed of the following five properties:
| Property | Description |
|---|---|
width |
The width of the photo in pixels. |
height |
The height of the photo in pixels. |
url |
The Yext-Hosted URL of the file. |
sourceUrl |
Source URL of the file. Only populates if uploaded by providing a hosted URL. |
thumbnails (Legacy) |
A legacy feature generating thumbnails of various sizes for a photo upon upload. This functionality has been replaced by dynamic image transformation. |
Validation
You can configure validation for Photo custom fields and Photo custom field types.
| Option | Available Validation | Default | Accepted Values |
|---|---|---|---|
| Width | Set the minimum width in pixels | 0 | Whole numbers 0-1,000 |
| Height | Set the minimum height in pixels | 0 | Whole numbers 0-1,000 |
| Aspect Ratio | Set the accepted ratio of width to height | Unconstrained | Unconstrained, 1:1, 4:3, 3:2, 5:3, 16:9, 3:1,2:3, 5:7, 4:5, 16:10 |
Limitations
| Option | Accepted Values |
|---|---|
| Image size | Up to 100 megapixels |
| Image format | JPEG, PNG, BMP, GIF, TIFF, WEBP |
Uploading Photos
Photos can be uploaded using all interfaces for editing entities in the Knowledge Graph.
All interfaces support photo uploads by referencing a source URL. Uploading a photo from a local file system is only supported in Entity Edit.
To upload a photo that is hosted online, populate the photo URL in the url property. This URL will then be propagated to the sourceUrl property, while the URL field will be the Yext-hosted URL of the photo.
Updating Photos
To change the photo that is being stored in a given Photo field, update the value of the url property to be the new hosted photo’s URL. Sending updates directly to the sourceUrl property is not supported.
Accessing Photos
Once an image has been uploaded to an entity, its hosted URL is kept as a reference in the entity’s field. You can access the entity via API to retrieve the photo’s URL directly, for example:
With other fields elided, the response looks like this:
{
"response": {
"entities": [{
"photoGallery": [{
"image": {
"width": 314,
"height": 366,
"url": "http://a.mktgcdn.com/p/Oua5ocwC7euaUFkJ-V8n3OpF76Xtfh_rdsDT9ki_laY/314x366.jpg"
}]
}]
}
}Every image is assigned a long UUID (the long random string above), so the URL has the form: a.mktgcdn.com/p/UUID/WIDTHxHEIGHT.EXT.
Both HTTP and HTTPS are supported.
Custom Field Types
You can create custom field types to group multiple fields together into a single complex field. For example, you could create a "Business Hours Override" field type with subfields for day, open time, and close time.
You’ll usually use the built-in field types in Yext. If necessary for your use case, you can also create custom field types.
To create a custom field type:
- Navigate to Knowledge Graph > Configuration and click the Field Types tile.
-
Click Add Custom Field Type.
-
Enter the basic information for your custom field type.
- Field Type Name
- API Name: This will be automatically set based on the name, but you can modify it if desired.
-
Type Description (optional)
- If you're using alternate language profiles, add translations to your custom entity type. Click Add translation on the Name or Description setting.
- Choose your desired language and enter the translated value. Click Save or Save & Add Another to add another translation to the same setting.
- Add the individual fields that will make up your new field type. To start, click Add a subfield.
- Enter the settings for your subfield.
- Subfield type: choose the type of subfield you want to add. Depending on your chosen field type, you may see slightly different settings.
- Subfield label: enter a label for the subfield. Add translations if desired.
- Validation: set validation rules such as a minimum or maximum character count, or other accepted content in the subfield.
- Settings: choose whether this subfield should be required when populating your custom field, and whether this subfield has list options.
- Click Add a subfield to add any other subfields.
- Click the trash can icon on a subfield to remove it.
- Click Save at the bottom of the screen to save your custom field type.