Skip to end of metadata
Go to start of metadata

Introduction

File schemas can be inherited from activities that are adjacent to a transformation, as described here, or they can be defined directly in the transformation. Schemas defined in an activity are not considered part of the transformation but are instead inherited by the transformation when a schema is not directly defined in the transformation.

Defining a Schema in an Activity

The ability for a user to provide a schema is included as a step in the configuration of a file-based activity. An example of defining a schema in a file share read activity is included below. For endpoint-specific information, refer to the sections under Connectors.

Other types of schemas that are not file-based retrieve any applicable schemas directly from the endpoint, such as is the case with SOAPdatabase, and Salesforce endpoints, as well as some custom endpoints. These types of schemas are sometimes referred to as server-based schemas. These types of schema are always automatically defined by the activity, and cannot by provided by a user within the activity or defined in the transformation.

Within the configuration of each file-based activity, there is a section called Provide Response Schema or Provide Request Schema. Within this section, select one of three options:

  • No: Choose this option to skip defining a schema in the activity. You may want to select this option if you plan to define the schema later directly within the transformation (see Schemas Defined in a Transformation), or if no schema is required for your use case (see When to Use a Schema).
  • Yes, Use Saved Schema: Choose this option to select an existing file schema that has previously been defined in the current project. When this option is selected, this section becomes available:

    • Saved Schemas: Use the dropdown to select from an existing schema to reuse.

    • View/Edit Schema: After an existing schema is selected, you can view or edit it directly within the text area below the dropdown, or click the popout icon  to edit it in a larger area (once within that area, click the return icon  to come back to this screen).

      NOTE: This area is not applicable for saved schemas that were originally created as a custom flat schema or custom hierarchical schema.

      As you edit a schema, validation information will be provided below the text area, with any errors reported one line at a time. That is, after resolving an error on one line, additional syntax errors to resolve may be reported for subsequent lines.

      WARNING: If you edit a saved schema but do not change its name, when uploading the schema a popup will ask you to acknowledge that the edits will affect other areas of the project where the saved schema is used. If you click Continue, the edits will take effect in all of these areas. If you don't want to affect other areas where the saved schema is used, click Cancel and then edit the schema name, then try to upload it again.

  • Yes, Provide New Schema: Choose this option to define a new schema by loading one from a URL, uploading a file, or manually entering one into the text area. When this option is selected, this section becomes available:

    • Schema Name: Enter a name for the schema into the upper text box, including the file extension (.json, .xml, .xsd, .csv, or .zip). If no file extension is provided, the file will be treated as JSON by default. If you will be loading the schema from a URL or uploading a file, you can leave this blank, as the name will be populated once the file is loaded.

    • Load URL: Click this button to open a window where you can load a schema from a URL:

      • File Type: Use the dropdown to select from the supported file types, including JSONXML, XSDCSV, and ZIP. Take note:
        • XSD: An XSD provided by URL can import/include other XSD URLs by reference. Cyclical references are not supported.

        • ZIP: A ZIP archive should contain a collection of XSDs, which may import/include each other by reference. Any non-XSD files in the archive will be ignored. Multiple directory levels are supported.

      • URL: Enter a URL that is accessible without authentication. Files up to 10 MB in size can be uploaded.
      • Load: Click this button to load the schema from the URL. Note that the file is retrieved only a single time for schema generation. In addition, be aware that some data may be converted during processing as described in Schema Processing.

        NOTE: When uploading an XSD file that contains multiple top-level elements, you will be prompted to select the desired root node. Select the element and then click Finish to upload the file:

      • Cancel: Click Cancel to close the Upload Schema URL window without saving.
    • Upload File: Click this button to open a window where you can load a schema from a file that is accessible from the current machine:

      • File Type: Use the dropdown to select from the supported file types, including JSONXML, XSDCSV, and ZIP. Take note:

        • XSD: Cyclical references are not supported.

        • ZIP: A ZIP archive should contain a collection of XSDs, which may import/include each other by reference. Any non-XSD files in the archive will be ignored. Multiple directory levels are supported.

      • File: Use the Browse button to the right to browse to a file that has not yet been used in the current project. Files up to 10 MB in size can be uploaded.

        WARNING: If you try to upload a file with the same name as an existing file already defined in the project, a popup will ask if you want to overwrite the existing file. If you click Continue, the file will be replaced with the new file with the same name in all places where it is used in the project. If you don't want to overwrite the file, click Cancel and then manually modify the file so it has a name that is not already being used, then try to upload it again.

      • Load: Click this button to load the schema from the file. Note that some data may be converted during processing as described in Schema Processing.

        NOTE: When uploading an XSD file that contains multiple top-level elements, you will be prompted to select the desired root node. Select the element and then click Finish to upload the file:

      • Cancel: Click Cancel to close the Upload Schema File window without saving.
    • View/Edit Schema: After a schema is loaded, you can view or edit it directly within the text area below the Load URL and Upload File buttons, or click the popout icon  to edit it in a larger area (once within that area, click the return icon  to come back to this screen). Another option is to manually enter or paste a schema into this area without loading a schema from a URL or file.

      As you edit a schema, validation information will be provided below the text area, with any errors reported one line at a time. That is, after resolving an error on one line, additional syntax errors to resolve may be reported for subsequent lines.

Accessing Menu Actions

After a schema is defined in an activity, you can access additional menu options that are available for all schemas.

These include deleting, viewing dependencies of, deploying, or configurable deploy of a schema, as well as re-opening the activity configuration screen.

For details on these actions, see Schema Menu Actions.

On This Page

Related Articles

Last updated:  Aug 06, 2019

  • No labels