Use of Import mapping And Export Mapping

0
I want to know what is use of Import mapping And Export Mapping while implementing Rest API , Why it is used?
asked
3 answers
0

Export mappings are used to created JSON or XML content using data in your Mendix app for an outgoing REST request.

 

Import mappings are used to take JSON or XML content received via a REST request made to your Mendix app and put the information from that content into your Mendix domain model.

answered
0

Hi RaviPrakash Ram,

  1. Import Mapping:

    • Purpose: Import Mapping is used to transform data from an external source (such as a REST API response) into Mendix entities. It allows you to map the incoming data to your domain model.
    • Scenario: Suppose you’re consuming data from an external REST API, and you want to create or update Mendix entities based on that data. You define an Import Mapping to specify how the incoming data should be mapped to your domain model attributes.
    • Steps:
      1. Create an entity in your Mendix domain model that corresponds to the data you want to import.
      2. Define an Import Mapping by specifying the source (REST API response) and the target (Mendix entity).
      3. Map the attributes from the source data to the corresponding attributes in your Mendix entity.
      4. When you receive data from the REST API, Mendix will automatically transform it using the Import Mapping and create/update the relevant entities.
  2. Export Mapping:

    • Purpose: Export Mapping is used to transform Mendix entities into a format suitable for external consumption (e.g., sending data to a REST API).
    • Scenario: Imagine you need to send data from your Mendix application to an external system via a REST API. You define an Export Mapping to specify how your Mendix entities should be transformed into the desired format (e.g., JSON).
    • Steps:
      1. Create a JSON structure that represents the desired format for your data (similar to the body you want to send in the REST API request).
      2. Define an Export Mapping by specifying the source (Mendix entity) and the target (JSON structure).
      3. Map the attributes from your Mendix entity to the corresponding fields in the JSON structure.
      4. When you need to send data to the external system, use the Export Mapping to transform your Mendix entity into the appropriate format.

In summary:

  • Import Mapping helps you bring external data into your Mendix application.
  • Export Mapping allows you to format Mendix data for external consumption (e.g., sending it via REST APIs).

I hope you will have a good idea now, Happy Mendix Development!

answered
0

Hi Raviprakash Ram,

 

Import mapping in Mendix is used to transform incoming data from an external source (like a REST API) into Mendix objects. It maps the structure of the external data to the structure of your domain model.

 

Export mapping is used to transform data from your Mendix application into the format required by an external system. It maps your Mendix objects to the structure expected by the external system.

 

Thanks,

Amit G

answered