Mixin Schemas
Create schemas for custom mixin properties.
Last updated
Was this helpful?
Create schemas for custom mixin properties.
Last updated
Was this helpful?
The Mixin Schemas section allows extending entities in Management Dashboard, for example a product, with customized fields of different types.
There are two ways to define a new schema in Management Dashboard:
defining a schema manually
uploading a json file
Go to Settings -> Mixin Schemas and choose Add new mixin schema.
Select an entity or multiple entities that you want to customize from the dropdown menu and enter the name for the schema. You can also provide a key value for your new schema, which then works as its unique identifier. If you don't provide the key value on your own, it's generated automatically.
The localized name you define for the schema later appears as a separate tab in the modified entity.
Choose the Confirm button.
Go to Fields tab and choose + icon to add a mixin field.
Type: Select a field type relevant to its purpose.
Key: Define a name of the field.
Name: Provide the name to display and its translation in desired languages.
Array Type (only for the array type): Choose the relevant type of values in an array.
Values (only for enum type): Define the default values for the field. Confirm each value with Enter key.
Provide relevant configuration in Settings:
Localized (only for text type): Decide whether the field is translated to other languages.
ReadOnly: Decide whether the field is non-editable.
Required (except for boolean type): Decide whether the field is mandatory.
Nullable: Decide whether the field can accept null
values.
Array Localized (only for text in Array Type): Decide whether texts within the array are localized.
Array Values (only for enum in Array Type): Define the default values for the field. Confirm each value with Enter key.
Save a field with Confirm button.
Repeat these steps to add as many fields as you require for the given entity.
If you've added fields of object type or of array of objects type, choose + icon within the given row to define the object's fields (only for object and array of objects types).
When you're done with defining mixin schema fields, confirm schema creation with Save. This action generates the schema for a particular entity or entities.
Result: The new schema is in use. It means that if, for example, you've created a schema called Size for a product entity, next time you create or edit a product, the new fields are available in a Size tab.
The schemas of object type display the defined objects as nested within a hierarchical structure:
The schemas of array of objects type also allow for adding objects with the defined fields:
Updating schema by json file might be useful when you have an already defined data model.
Go to Settings -> Mixin Schemas and choose Add new schema.
Choose an entity or multiple entities that you want to customize from the dropdown menu and enter the name for the schema.
Choose the schema file from your device or drag and drop it to the selected area and choose Confirm.
Confirm the new schema creation with Save.
Result: The new schema is in use. It means that if, for example, you've updated a schema for a product entity, next time you create a product, the new fields are available in a separate tab called the same as your schema.
Go to Settings -> Mixin Schemas and select the schema you want to change. Choose the Edit icon to modify it.
Make changes to the schema or to particular fields in the schema:
In Schema tab, you can select or unselect entities types you want to apply the schema to.
In Fields tab, you can change settings for particular fields, add more or remove fields from the schema.
Confirm your changes with Save and confirm you want to update the existing schema.
Each time you edit a schema, you generate its new version. This behavior is to prevent validation errors for the objects that were created/edited earlier and use the older schema versions. The latest schema version is always applied by default.
Result: A new version of the schema has been uploaded and is now in use.
You can add a mixin field as a column in the list view of a selected entity. The mixin field can serve as a filter so that you can find the items of your interest.
Go to the selected entity view and choose the Orchestration icon.
In the Mixins section, look for the mixin fields you want to add as filter columns.
The selected mixin fields appear in the list.
Adjust the way how the columns are displayed with Edit icon. You can edit the displayed label of the mixin column.
Save the selection. The columns appear instantly in the entity list view.
Only the mixins defined in the Schema Service can serve as column filters. If you use the API to create mixins instead of the Schema Service, you won't be able to add the mixin fields from the API upload. To get around this, first define the mixin fields for a given entity in the Schema Service.
Adding mixins as column filters is possible for the following entities: category, company, coupon, customer, customer address, order, price list, product, quote, and return.
If you no longer want to apply the latest version of a schema to an entity, you can unassign it.
Go to Settings -> Mixin Schemas and select the schema you want to remove from an entity.
Choose Unassign icon to remove connection between the latest schema version and entity.
Confirm the action with Yes.
Result: The particular entity uses the previous version of the schema that exists in the database. If you had only one schema version and you unassign it from an entity, the schema tab is no longer visible when you create or edit objects of that type.
If you want to learn how to create json schema file, see .
The unassigned schemas are not displayed in the Management Dashboard. To retrieve, edit or delete an unassigned schema, use API mechanism. See more in .