If you are using a schema on the source or target side of a transformation and want to copy its structure to use on the other side of the transformation, you can mirror the schema within the transformation.
Mirroring a schema is possible only when the source or target that the schema is being copied to is not an adjacent server-based activity whose schema is generated directly from the endpoint, such as is the case with Database, NetSuite, Salesforce, and ServiceMax endpoints, as well as many other application-specific endpoints and some custom endpoints.
Creating a Mirrored Schema
The option to mirror a schema is available only when certain conditions are met. This section first describes when mirroring is available, and then covers how to mirror a schema. The resulting schema generated from mirroring a schema is in the same format as the schema being mirrored. For example, if you mirror a JSON schema, you will get a JSON schema; if you mirror an XML schema, you will get a resulting XML schema, etc.
When Mirroring Is Available
To be able to mirror a schema, first add a transformation to an operation and define either its source or target schema in any of the ways described in either Schemas Defined in an Activity or Schemas Defined in a Transformation (except for the mirror schema option).
Depending on whether the source or target schema is defined, the schema on the other side of the transformation must not be defined in order for the mirroring option to be available. If the operation has an activity on the other side of the transformation, during activity configuration when providing a request or response schema, make sure to select None in the file schema dropdown selection so that the schema is not inherited by the transformation.
The source or target that the schema is being copied to cannot be an adjacent server-based activity; however, any source or target activity that is file-based can have a schema copied to it, even if the source of the copy is from a server-based activity. For example, you can mirror the schema generated from a Database Query used as the source of a transformation if the target of a transformation is a file-based activity such as an FTP Write activity. However, you cannot mirror a schema provided by an FTP Read activity to use as the target schema for a Database Insert activity, as you must use the schema generated by the Database endpoint. In such cases, the mirroring option will not be present.
Mirror a Schema
Provided the above conditions are met, the mirroring option will be displayed in mapping mode on the source or target side of the transformation. Within the transformation, click the appropriate button for Mirror Target Schema or Mirror Source Schema on the respective side of the transformation:
Source Side: To copy a schema used on the target side of the transformation to the source side, click Mirror Target Schema on the source side:
Target Side: To copy a schema used on the source side of the transformation to the target side, click Mirror Source Schema on the target side:
This copies the source or target structure from one side of the transformation to the other, respectively, creating a new JSON schema called "Mirrored Schema" by default:
In most cases, the resulting mirrored schema is an exact copy of the schema being mirrored, converted to JSON format. There are two exceptions provided as an aid to the user:
- Database Activities: If the schema being mirrored is from a Database activity using a single table (without joins), then the resulting mirrored schema will automatically be created with an additional child node called
row. When fields within this additional node are mapped to, the node becomes a loop node to allow all records to be looped through.
- Salesforce Activities: If the schema being mirrored is from a non-bulk Salesforce activity, then the resulting mirrored schema will automatically be created with an additional root node called
recordswith the child node(s) mirroring the schema. When fields within the child node(s) are mapped to, the node becomes a loop node to allow all records to be looped through.
Once created, the mirrored schema is independent of the source schema it was mirrored from. That is, you can rename or edit this schema in any way you choose without affecting the original source schema. Because mirroring a schema copies the entire schema, in this way you can first mirror a schema and then edit it to remove fields to trim the schema (for example, to copy a database schema for only some tables being joined).
Accessing Menu Actions
After a mirrored schema is created, you can access additional menu options that are available for all schemas.
These include deleting, renaming, viewing dependencies of, deploying, configurable deploying of, and adding to a group, as well as editing a schema or clearing a schema from a transformation. For details on these actions, see Schema Menu Actions.
Last updated: Jul 27, 2020
- No labels