A data mapping connects an ERP query response to a platform API model within ERP Manager's inbound integration chain. Use this overview to understand the records that a mapping depends on, the records that depend on it, and the diagnostic views available when its output or editability is unexpected.
The dependency chain
ERP Manager orders inbound integration records from client connections to basic queries, then data mappings, and finally API endpoints. Each layer is a prerequisite for the layer that follows it. A data mapping requires an existing basic query, and an API endpoint requires an existing data mapping.
A basic query defines the data fetched from the ERP system. The query is associated with a client connection that determines the targeted ERP instance.
A data mapping connects the basic query response to a platform API model.
An API endpoint exposes the mapped data set to the storefront.
Data mapping configuration
The create form uses Api model to select the platform model that the mapping targets. The required Basic query field links the mapping to its upstream query. The optional User query can further refine the records that the mapping processes. The Basic query picker lists queries that already exist for the active client. Without a value in Basic query, the form cannot be saved.
How locking works
When an API endpoint references a data mapping, the mapping becomes locked to protect the integration that uses it. A locked mapping displays the alert Data mapping is locked due to it's used in API Endpoint and has Save disabled. The locked record remains available for inspection through its five tabs, but edits cannot be persisted. The same lock can apply to a basic query that is used through a data mapping and its endpoint. The lock protects live integrations because changing a mapping that feeds an active endpoint could alter the API response on which the storefront and other consumers depend.
Diagnostic views
The data mapping record contains the tabs General Info, Response Preview, Logic Rules, Relation, and Api Preview. Each tab presents a different view of the same mapping for a different diagnostic question.
Use General Info to inspect the mapping name, ERP model root, API model, and linked basic query. The linked basic query opens its query record directly for inspection.
Use Response Preview to fetch the raw response from the linked basic query. Selecting View loads the response returned by the ERP. This tab helps distinguish an upstream query problem from a mapping problem.
Use Relation to inspect the field-level pairings between the ERP response and the platform API model. The Relation view presents Api Name, Response Name, Match, Erp logic rule, and Data mapping logic rule columns. A mismatch indicates that a platform field name and an ERP response field name do not resolve to each other.
Use Logic Rules to inspect transformation rules applied across the mapping. If the relation pairings are correct but the output is wrong, examine the logic rules next.
Use Api Preview to load the transformed output produced from the current ERP response. Selecting View applies the relations, logic rules, and model structure to the current ERP response. Use the preview to confirm the final output shape before an endpoint references the mapping.
Diagnose common problems
Compare Response Preview with Api Preview to separate upstream query problems from mapping problems.
If Response Preview already contains incorrect data, inspect the linked basic query's configuration and connection settings from General Info.
If Response Preview is correct but Api Preview is incorrect, inspect Relation first and then Logic Rules.
If Save is disabled without a lock alert, check whether the required Basic query field is empty.
If the lock alert is present, the mapping is in use by an API endpoint.
To make a locked mapping editable, remove or update the endpoint that references it.
If the Basic query picker is empty for the active client, create a basic query before creating the mapping.
The Api model dropdown is populated from the platform's built-in model list and does not depend on upstream records.
Related

