Skip to main content

Create a New Schema Template

This article provides information about adding a schema template to the schema template library in Nexla.

For information about how to use schema templates in Nexla, see the Using Schema Templates article.

1. What Are Schema Templates?

Some tasks require that created Nexsets comply with a predefined, consistent dataset schema specification, such as when Nexsets will be sent to API destinations. In Nexla, this is achieved with schema templates, which define the desired structure of output data. Schema templates can be easily created, edited, and used when producing new Nexsets.

Schema templates function to provide visual guidance during Nexset creation, rather than creating attribute mappings. They are not enforced on any Nexset, meaning that users can choose whether to adhere to all or a portion of a selected template. This also means that schema templates can also be modified at any time without risking an impact to existing data flows.

2. Access the Schema Template Library

  1. To access the Schema Template Library in Nexla, hover over Tools.png on the toolbar on the left side of the screen, and select Schema_Template_Library.png from the menu that appears.

      Tools_Menu.png

3. Define a New Schema Template

  1. In the Schema Template Library, to begin creating a new schema template, click Create_New_Schema_Template.png in the top right corner of the screen.

  2. In the left panel on the screen, labeled Define.png, enter a name for the schema template in the Name field.

      Name.png

  3. Optional: Enter a description of the schema template in the Description field.

      Description.png

  4. In the Input Samples to Generate Schema field, enter a JSON array of 2-3 input samples that match the desired structure.

    These samples are not required to contain real data.

      Input_Samples.png

  5. Click Generate_Schema.png in the middle of the screen to generate a test preview of the schema in the right panel on the screen, labeled Test.png.

      Preview.png

  6. Optional: The output schema test samples can also be viewed in JSON or column format by selecting the corresponding option from the pulldown menu in the top left of the Test panel.

      Select_JSON.png

  7. Confirm that the output samples are as expected. If not, changes can be made in the Define panel, and a new schema test preview can be generated. Once the generated test schema produces the desired result, click Create.png in the top right corner of the screen to save the schema template.

4. Create a Schema Template from an Existing Nexset

  1. To create an schema template based on an existing Nexset, click the View_Nexset.png icon on the desired Nexset.

      View_Nexset2.png

  2. In the window that opens on the right side of the screen, select the Schema_Tab.png tab.

  3. Select the "Attributes as JSON" option from the menu indicated below.

      View_JSON.png

  4. Select and copy the JSON code corresponding to 2-3 of the Nexset samples shown.

      Copy_Attribute.png

  5. Access the Schema Template Library as described in Section 2, and click Create_New_Schema_Template.png in the top right corner of the screen.

  6. In the left panel of the screen, labeled Define.png, enter a name for the schema template in the Name field.

      Name.png

  7. Optional: Enter a description of the schema template in the Description field.

      Description.png

  8. Paste the JSON code copied in Step 4 between the brackets in the Input Samples to Generate Schema text field.

      Paste_Samples.png

  9. Click Generate_Schema.png in the middle of the screen to generate a test preview of the schema in the right panel on the screen, labeled Test.png.

      Preview.png

  10. Optional: The output schema test samples can also be viewed in JSON or column format by selecting the corresponding option from the pulldown menu in the top left of the Test panel.

      Select_JSON.png

  11. Confirm that the output samples are as expected. If not, changes can be made in the Define panel, and a new schema test preview can be generated. Once the generated test schema produces the desired result, click Create.png in the top right corner of the screen to save the schema template.