Importing JSON File and Displaying the data with filters

0
I have a doubt how can I import JSON files into my mendix app in order to filter the data and just show for example a simple report. The problem is the data is not at my local directory but built as an artifact in my CI/CD pipeline . This json file needs to be captured by my app through any service like exposing endpoints etc . So please help me in retrieving and displaying the json format data in a mendix app with filters . 
asked
2 answers
1

Hi Parag, to import a JSON file into your Mendix app from a CI/CD pipeline artifact, follow these steps:

  1. Expose the JSON file via a REST endpointmake sure your CI/CD pipeline (GitLab,) provides a public or authenticated HTTP URL to access the artifact (the JSON file). Most CI/CD platforms offer APIs to download artifacts.

  2. Consume the JSON in Mendix using a REST Call In Mendix, use a "Call REST" action in a microflow to make a GET request to the endpoint. Include authentication headers if needed.

  3. Create a JSON Structure and Import Mapping

    • Use the JSON content to define a JSON structure in Mendix.

    • Create an Import Mapping that maps the JSON to non-persistable or persistable entities depending on your need.

  4. Store or Process the Data Use the imported data to populate your domain model. You can persist it if you want filtering/searching capabilities or keep it non-persistable for lightweight, temporary use.

  5. Display and Filter the Data, add a Data Grid, List View, or any reporting widget to show the imported data. Use XPath constraints or microflows to enable filtering.

I hope this one helps you :)

answered
5

Hello Parag, 

As per your questions seems you want to retrieve json file from server. 

1.Host your JSON file on a server or cloud storage e.g., AWS S3. 

2.Consume the JSON in Mendix,

use a REST Call in Mendix to fetch the JSON data.

3.Import mapping

Create a JSON structure in Mendix, add import mapping to import the json. 

4.store the imported data into non persistent entity. 

5.use datagrid, xpath, list view to filter the data. 

answered