Custom Field: Structured Data (Json) Type
Last updated
Last updated
You must be an Administrator to be able to perform these actions.
Custom Fields are Registry wide.
The Aristotle Metadata Registry allows site administrators to add their own custom fields to metadata items. Currently, the custom fields support data types such as integers, text, rich text, date, and choice.
To enhance customisation, we're introducing a new 'Structured Data (Json)' custom field type. This feature enables clients to create their own custom fields using JSON Schema, which will describe what values are allowed for the custom field’s value and provide information for generating user interfaces for display and editing.
This help page exclusively covers the 'Structured Data (JSON)' custom field type. For more information on custom fields, please visit this link.
With this update, you can now add multiple custom fields at once using the 'Structured Data (JSON)' type. Administrators can define these fields by adding JSON code in the JSON Schema, as shown in this reference link: https://json-schema.org/.
You can configure the editor layout by writing JSON forms code, accessible through 'Open Item Editor' and the 'Slots' tab. Reference this link for guidance: https://jsonforms.io/.
Additionally, you can define the View layout using JSON or Jinja, determining how it appears on the item page.
Let's look at an example to gain a better understanding of how the 'Structured Data (JSON)' type works:
I have the 'Employee Information Dataset' below and would like to add details of Aristotle Metadata employees, including their names, positions, and contact emails. I can say that I kind of want to add a reference data for this dataset.
The easiest way to do this is to add a custom field named 'Employee Details.' To do so, go to 'Administrator Tools', then click on 'Manage Custom Fields'.
I will add the custom field for 'All'. Alternatively, you can choose to add it for the 'Data Set' only.
Click on 'Add Custom Field for All Models.' Name it 'Employee Details,' select the Type as 'Structured Data (JSON),' and assign a system name of your choice.
Scroll down and select the visibility as 'Public' and State as 'Active & Visible'. Copy and paste the below codes:
Json Schema -
Editor Layout -
View Layout -
Click on 'Submit Edits'.
Navigate to any metadata item; in this case, I'm returning to my 'Employee Information Dataset.' Click on 'Actions,' then select 'Open Item Editor.' Proceed to the 'Slots' tab, where you'll find 'Employee Details.' You can add as many employee details as you need and then click 'Save Changes'.
This is how it appears on the item page after saving.
Similarly, you can add as many custom fields as you'd like by including JSON code for each.
Because of the complexity of writing JSON Schema and JSON Forms, below are some tools that may help with devleoping JSON Forms quickly:
JSON Forms Editor: https://jsonforms-editor.netlify.app/
JSON Forms Playground: https://prismatic.io/docs/jsonforms/playground/
JSON Schema Editor: https://json-schema-editor.tangramjs.com/editor.html#/