How to get JSON data from local

I have a JSON file, and want to use my mendix project to get json data from this file, what should I do? May I know the procedures for this. The json data format is below: { "GridDataList": [ { "Currency": "$(M)", "Geo": "AP", "GroupLevels": [], "ID": "2", "KpiItemList": [ { "Name": "Target Budget", "Value": "317.6" }, { "Name": "Sales Forecast", "Value": "0.0" }, { "Name": "Funded Volume", "Value": "0.0" }, { "Name": "CD Forecast", "Value": "0.3" } ], "TimeString": "As of: 28 Feb 2013 07:58 PM", "Title": null } ], "TimeString": "As of: 28 Feb 2013 07:47 PM" } Thanks in advance.
1 answers

Hi Tingk,

Import the CommunityCommons modules and Rest Services modules from the Appstore. Assuming the json is in a filedocument of your project:

  1. Use the StringFromFile java action of community commons to retrieve the string contents.
  2. You can then use the deserializeJsonToObject java action of RestServices to parse the JSON body