How to use string in array of the Request in Rest Service API Mendix?

0
I'm seeking guidance on how to incorporate the following JSON-formatted array into a REST API request: {"mitra_code":"","code":","kode_loket":","group_id":0,"dari":"2024-04-01,"sampai":"2024-07-12,"filterType":["3","4","402","92","10","11","113","116","117","404","120","125","16","90","91","22","20","41","42","43","50","40","21","30","61","52","101","114","114","114","110","69","60","68","70","71","72","73","123","122","124","12"]}
asked
2 answers
0

First create a JSON Structure having your content:

image.png

Make sure your string is a valid JSON. In your copy several double quotes are missing, for instance "code";", has to be "code":"" .

 

Then create an export mapping, having schema source 'JSON Structure' and select your JSON as source.

image.png

 

Then, to get the database structure, click button 'Map automatically', or if you already have the entities present in your domain model, drag&drop them.

 

As a result you can now create a microflow that gathers the Root element. Call the REST using your export mapping directly in tab 'Request' after you have choosen 'Export mapping for the entire request'

image.png

 

Another option, giving you more control over the exportmapping, is to first create the export mapping, and use the result in tab request by selecting 'Custom request template': image.png

answered
0

and after this, how to input value of filterTypeItems?

it should be string one by one or just like this "3","4","5" or should using loop ?

answered