Need to create Post Request in cross Domain Modules App For showing it in dashboard via API.

0
Specifically, I'm trying to create a non-persistable entity in the domain module called `operationaldata`. However, the direct attributes are not visible in the domain modules. I'm new to Mendix as a platform, and I'm trying to create this non-persistable entity as mentioned before. As I'm trying to make an API request across domains, I'm getting issues. I've shared some additional information: additional information.(additional information contains mendix app in compressed format)  Please provide the complete steps I should follow to create the POST request in the cross-domain module and display the data in the dashboard via API.
asked
1 answers
0

hi,


In Mendix non-persistent entities (NPEs) are module-local, so you cannot directly use attributes of an NPE defined in Module A inside Module B. That’s why the attributes are not visible when you try to access them from another domain module.

Correct, working pattern

  1. Define the API request NPE in one module
    • Create the non-persistent entity inside the module where you will call the API.
    • Map the JSON structure to this NPE using an Import Mapping.
  2. Call the API in a microflow
    • Use Call REST (POST) in that same module.
    • Build the payload with a microflow, export mapping, or NPE.
    • Parse the response into the NPE using an Import Mapping.
  3. Return the NPE list from the microflow
    • Your microflow should return a List of NPEs that represent the API response.
  4. Use the microflow as the data source in the dashboard
    • Bind the dashboard to a microflow that returns the NPE list.
  5. Do NOT try to share the NPE across modules
    • Instead, expose a microflow in Module A that returns the NPE list.
    • Call that microflow from Module B (dashboard) to retrieve the data.

Why this works

Mendix does not share non-persistent entities across modules by design. The supported way to exchange API data between modules is by using microflows as boundaries, not by sharing NPEs.


answered