Export XDM schemas in the UI export-xdm-schemas-in-the-UI
All resources within the Schema Library are contained in a specific sandbox within an organization. In some cases, you may want to share Experience Data Model (XDM) resources between sandboxes and organizations.
To address this need, the Schemas workspace in the Adobe Experience Platform UI allows you to generate an export payload for any schema within in the Schema Library. This payload can then be used in a call to the Schema Registry API to import the schema (and all dependent resources) into a target sandbox and organization.
Prerequisites
While the Platform UI allows you export XDM resources, you must use the Schema Registry API to import those resources into other sandboxes or organizations to complete the workflow. Refer to guide on getting started with the Schema Registry API for important information regarding required authentication headers before following this guide.
Generate an export payload generate-export-payload
Export payloads can be generated in the Platform UI from the details panel in the Browse tab or directly from the canvas of the schema in the Schema Editor.
To generate an export payload, select Schemas in the left navigation. Within the Schemas workspace, select the row for the schema you want to export to display schema details in the right sidebar.
Next, select the Copy JSON icon ( ) from the available options.
This copies a JSON payload to your clipboard, generated based on the schema structure. For the “Loyalty Members” schema shown above, the following JSON is generated:
code language-json |
---|
|
The Payload can also be copied by selecting More in the top right of the Schema Editor. A dropdown menu provides two options, Copy JSON structure and Delete schema.
The payload takes the form of an array, with each array item being an object that represents a custom XDM resource to be exported. In the example above, the “Loyalty details” custom field group and the “Loyalty Members” schema are included. Any core resources employed by the schema are not included in the export, as these resources are available in all sandboxes and organizations.
Note that each instance of your organization’s tenant ID appears as <XDM_TENANTID_PLACEHOLDER>
in the payload. These placeholders will be automatically replaced with the appropriate tenant ID value depending on where you import the schema in the next step.
Import the resource using the API import-resource-with-api
Once you have copied the export JSON for the schema, you can use it as the payload for a POST request to the /rpc/import
endpoint in the Schema Registry API. See the import endpoint guide for details on how to configure the call to send the schema to the desired organization and sandbox.
Next steps
By following this guide, you have successfully exported an XDM schema to a different organization or sandbox. For more information on the capabilities of the Schemas UI, refer to the Schemas UI overview.