Consumed REST parsing JSON response question

0
I'm working on creating a Consumed REST service (GET method) to pull a simple list of Jira issues (tickets) into a Mendix datagrid. My status code 200 request successfully returns a list of some 300 issues, but I'm having issues parsing the issue fields of the Jira tickets into a variable that can be passed to my interface. Any ideas on how to achieve indexing these fields out for use in a grid? See screenshots below for reference:Mendix proceeds to create NPE in a simple flattened fashionI take the output of the API response and paste into the JSON snippet to create the JSON structure mapping Import Mapping selects just 3 fields (id, self, and key) for test purposesNext, configured call a rest request and import data mapping nodes within a microflow called by a button click. A breakpoint on the end event to debug details shows as follows but not sure how to pass back the inner details of each issue. Thoughts?quest
asked
2 answers
1

hi,


Your setup is almost correct. The missing piece is how Mendix handles arrays and nested objects in a Consumed REST response.

What’s happening

  • Jira returns an array: issues[]
  • Each issue has nested data under fields
  • Mendix does not auto-flatten nested JSON into a list you can bind directly to a grid
  • After the import mapping, you already have the data — it’s just inside associated objects

Correct way to handle this in Mendix

  1. Model the JSON properly
    • Root entity → association → Issue (0..*)
    • Issue → association → Fields (1..1 or 0..1)
    • Map only the fields you actually need (key, summary, status, etc.)
  2. Use Import Mapping with “Create objects”
    • Import mapping will create:
      • 1 Root object
      • N Issue objects (one per Jira issue)
      • Associated Fields objects
  3. Return the Issue list, not the Root
    • In your microflow, after “Import from JSON”:
      • Retrieve Issue objects by association from Root
      • Return List of Issue as output
  4. Bind the Data Grid to the Issue entity
    • Columns can use:
      • Issue/key
      • Issue/Fields/Summary
      • Issue/Fields/Status/Name (if modeled)

Key rule (this is the core answer)

You don’t “index” JSON in Mendix.
You navigate associations created by the import mapping.

Once the Issue objects are returned as a list, the grid will work normally.

Do not try to pass JSON strings or raw response data to the UI. Always let the Import Mapping create objects and work with those.


answered
1

The Import Mapping returns the Root object, not the Issue list. Jira issues are created as child objects under Root → Issues, so binding the grid to Root will not show issue fields.


What you need to do:


  • After the import, retrieve the Issue list via the Root–Issues association
  • Use that Issue list as the Data Grid datasource


Also, if you don’t map the fields under issues → fields (summary, status, etc.), they won’t be available in the grid.

So the key point is: the grid must use the Issue list, and the Issue entity must have the required fields mapped.


answered