Open the Schemas workspace

The Schemas workspace in the Platform UI provides a visualization of the Schema Library, allowing you to view manage the schemas available for your organization. The workspace also includes the Schema Editor, the canvas on which you can compose a schema throughout this tutorial.

After logging into Experience Platform, select Schemas in the left navigation to open the Schemas workspace. The Browse tab displays a list of schemas (a representation of the Schema Library) for you to view and customize. The list includes the name, type, class, and behavior (record or time-series) on which the schema is based, as well as the date and time the schema was last modified.

See the guide on exploring existing XDM resources in the UI for more information.

Create and name a schema

To begin composing a schema, select Create schema in the top-right corner of the Schemas workspace.

The Schemas workspace Browse tab with Create schema highlighted.

The Create a schema dialog appears. In this dialog, you can choose to either manually create a schema by adding fields and field groups, or you can upload a CSV file and use ML algorithms to generate a schema. Select a schema creation workflow from the dialog.

The Create a schema dialog with the workflow options and select highlighted.

Beta Manual or ML-assisted schema creation

To learn how you can use a ML algorithm to recommend a schema structure based on an uploaded file, see the machine learning-assisted schema creation guide. This UI guide focusses on the manual creation workflow.

Choose a base class

The Create schema workflow appears. Next, choose a base class for the schema. You can choose between the core classes of XDM Individual Profile and XDM ExperienceEvent, or Other if these classes do not suit your purposes. The Other classes option allows you to either create a new class or choose from other pre-existing classes.

See the XDM individual profile and XDM ExperienceEvent documentation for more information on these classes. For the purposes of this tutorial, select XDM Individual Profile followed by Next.

The Create schema workflow with the XDM individual profile options and Next highlighted.

Name and review

After you have selected a class, the Name and review section appears. In this section, you provide a name and description to identify your schema. There are several important considerations to make when deciding on a name for your schema:

  • Schema names should be short and descriptive so that the schema can be easily found later.
  • Schema names must be unique, meaning it should also be specific enough that it will not be reused in the future. For example, if your organization had separate loyalty programs for different brands, it would be wise to name your schema “Brand A Loyalty Members” to make it easy to distinguish from other loyalty-related schemas you might define later.
  • You can also use the schema description to provide any additional contextual information regarding the schema.

This tutorial composes a schema to ingest data related to the members of a loyalty program, and therefore the schema is named “Loyalty Members”.

​The schema’s base structure (provided by the class) is shown in the canvas for you to review and verify your selected class and schema structure.

Enter a human-friendly Schema display name in the text field. Next, enter a suitable description to help identify your schema. When you have reviewed your schema structure and are happy with your settings, select Finish to create your schema.

The Name and review section of the Create schema workflow with the Schema display name, Description, and Finish highlighted.

Compose your schema

The Schema Editor appears. This is the canvas upon which you will compose your schema. The self-titled schema is automatically created in the Structure section of the canvas when you arrive in the editor, along with the standard fields included in the base class that you selected. The assigned class for the schema is also listed under Class in Composition section.

NOTE
You can update the display name and optional description for the schema from the Schema properties sidebar. Once a new name is entered, the canvas automatically updates to reflect the new name of the schema.

The Schema Editor with the base class and schema diagram highlighted.

NOTE
You can change the class of a schema at any point during the initial composition process before the schema has been saved, but this should be done with extreme caution. Field groups are only compatible with certain classes, and therefore changing the class will reset the canvas and any fields you have added.

Add a field group

You can now begin to add fields to your schema by adding field groups. A field group is a group of one or more fields that are often used together to describe a particular concept. This tutorial uses field groups to describe the members of the loyalty program and capture key information such as name, birthday, phone number, address, and more.

To add a field group, select Add in the Field groups sub-section.

The Schema Editor with the Add Field groups button highlighted.

A new dialog appears, displaying a list of available field groups. Each field group is only intended for use with a specific class, therefore the dialog only lists field groups that are compatible with the class you selected (in this case, the XDM Individual Profile class). If you are using a standard XDM class, the list of field groups will be intelligently sorted based on usage popularity.

The Add field groups dialog.

You can select one of the filters in the left rail to narrow down the list of standard field groups to specific industries like retail, financial services, and healthcare.

The Add field groups dialog with the industry field groups highlighted.

Selecting a field group from the list causes it to appear in the right rail. You can select multiple field groups if desired, adding each one to the list in the right rail before confirming. In addition, an icon appears on the right side of the currently selected field group which allows you to preview the structure of the fields it provides.

The Add field groups dialog with the selected field group preview icon highlighted.

When previewing a field group, a detailed description of the field group’s schema is provided in the right rail. You can also navigate through the field group’s fields in the provided canvas. As you select different fields, the right rail updates to show details about the field in question. Select Back when you are finished previewing to return to the field group selection dialog.

The Preview field group dialog with the Demographic Details field group previewed.

For this tutorial, select the Demographic Details field group, then select Add field group.

The Add field groups dialog with the Demographic Details field group selected and Add field groups highlighted.

The schema canvas reappears. The Field groups section now lists “Demographic Details” and the Structure section includes the fields contributed by the field group. You can select the field group’s name under the Field groups section to highlight the specific fields it provides within the canvas.

The Schema Editor with the Demographic Details field groups highlighted.

NOTE
Within the Schema Editor, standard (Adobe-generated) classes and field groups are indicated with the padlock icon ( A padlock icon. . The padlock appears in the left rail next to the class or field group name, as well as next to any field in the schema diagram that is a part of a system-generated resource.
The Schema Editor with the padlock icon highlighted

This field group contributes several fields under the top-level name person with the data type “Person”. This group of fields describes information about an individual, including name, birth date, and gender.

NOTE
Remember that fields may use scalar types (such as string, integer, array, or date), as well as any data type (a group of fields representing a common concept) defined within the Schema Registry.

Notice that the name field has a data type of “Full name”, meaning it too describes a common concept and contains name-related sub-fields such as first name, last name, courtesy title, and suffix.

Select the different fields within the canvas to reveal any additional fields they contribute to the schema structure.

Add more field groups

You can now repeat the same steps to add another field group. When you view the Add field group dialog this time, notice that the “Demographic Details” field group has been greyed out and the checkbox next to it cannot be selected. This prevents you from accidentally duplicating field groups that you have already included in the current schema.

For this tutorial, select the standard field groups Personal Contact Details and Loyalty Details from the list, then select Add field groups to add them to the schema.

The Add field groups dialog with two new field groups selected and Add field groups highlighted.

The canvas reappears with the added field groups listed under Field groups in the Composition section, and their composite fields added to the schema structure.

The Schema Editor with the new composite schema structure highlighted.

Define a custom field group

The Loyalty Members schema is meant to capture data related to the members of a loyalty program, and the standard Loyalty Details field group that you added to the schema provides most of these, including the program type, points, join date, and more.

However, there may be a scenario where you want to include additional custom fields not covered by standard field groups in order to achieve your use cases. In the case of adding custom loyalty fields, you have two options:

  1. Create a new custom field group to capture these fields. This is the method that will be covered in this tutorial.
  2. Extend the standard Loyalty Details field group with custom fields. This causes Loyalty Details to be converted to a custom field group, and the original standard field group will no longer be available. See the Schemas UI guide for more information on adding custom fields to the structure of standard field groups.

To create a new field group, select Add in the Field groups sub-section like before, but this time select Create New Field group near the top of the dialog that appears. You are then asked to provide a display name and description for the new field group. For this tutorial, name the new field group “Custom Loyalty Details”, then select Add field groups.

The Add field groups dialog with Create new field group, Display name and Description highlighted.

NOTE
As with class names, the field group name should be short and simple, describing what the field group will contribute to the schema. These too are unique, so you will not be able to reuse the name and must therefore ensure it is specific enough.

“Custom Loyalty Details” should now appear under Field groups on the left side of the canvas, but there are no fields associated with it yet and therefore no new fields appear under Structure.

Add fields to the field group

Now that you have created the “Custom Loyalty Details” field group, it is time to define the fields that the field group will contribute to the schema.

To begin, select the plus (+) icon next to the name of the schema in the canvas.

The Schema Editor with the plus icon highlighted.

An “Untitled Field” placeholder appears in the canvas, and the right rail updates to reveal configuration options for the field.

The Schema Editor with an Untitled Field and the schema Field properties highlighted.

In this scenario, the schema needs to have an object-type field that describes the person’s current loyalty tier in detail. Using the controls in the right rail, start creating a loyaltyTier field with type “Object” that will be used to hold your related fields.

Under Assign to, you must select a field group to assign the field to. Remember that all schema fields belong to either a class or a field group, and since this schema uses a standard class, your only option is to select a field group. Start typing in the name “Custom Loyalty Details”, then select the field group from the list.

When finished, select Apply.

The Schema Editor with the Loyalty Tier object added to the schema Field properties highlighted.

The changes are applied and the newly created loyaltyTier object appears. Since this is a custom field, it is automatically nested within an object namespaced to your organization’s tenant ID, preceded by an underscore (_tenantId in this example).

The Schema Editor with the tenant ID and Loyalty Tier highlighted in the schema diagram.

NOTE
The presence of the tenant ID object indicates that the fields you are adding are contained in your organization’s namespace.
In other words, the fields you are adding are unique to your organization and are going to be saved in the Schema Registry in a specific area accessible only to your organization. Fields you define must always be added to your tenant namespace to prevent collisions with names from other standard classes, field groups, data types, and fields.

Select the plus (+) icon next to the loyaltyTier object to start adding sub-fields. A new field placeholder appears and the Field properties section is visible on the right side of the canvas.

The Schema Editor with the tenant ID and new sub field added to the Loyalty Tier in the schema diagram.

Each field requires the following information:

  • Field Name: The name of the field, preferably written in camelCase. No space characters are allowed. This is the name used to reference the field in code and in other downstream applications.
    • Example: loyaltyLevel
  • Display Name: The name of the field, written in title case. This is the name that will be displayed in the canvas when viewing or editing the schema.
    • Example: Loyalty Level
  • Type: The data type of the field. This includes basic scalar types and any data types defined in the Schema Registry. Examples: String, Integer, Boolean, Person, Address, Phone number, etc.
  • Description: An optional description of the field should be included with a maximum of 200 characters.

The first field for the loyaltyTier object will be a string called id, representing the ID of the loyalty member’s current tier. The tier ID will be unique for each loyalty member, since this company sets different loyalty tier point thresholds for each customer based on different factors. Set the new field’s type to “String”, and the Field properties section becomes populated with several options for applying constraints, including default value, format, and maximum length. See the documentation on best practices for data validation fields to learn more.

The Schema Editor with the field property values for the new ID field highlighted.

Since id will be a randomly generated freeform string, no further constraints are necessary. Select Apply to apply your changes.

The Schema Editor with the ID field added and highlighted.