Read JSON Object

shanabeywicrema
Member Posts: 53
Can we extract Object (nested Object) name from this kind of JSON? I am able to count how many objects are in the json, but cannot extract value. ("27675","27676") I am using Newtonsoft
"27675":{
"entity_id":"27675",
"status":"complete",
"coupon_code":null,
"shipping_descript
},
"27676":{
"entity_id":"27676",
"status":"complete",
"coupon_code":null,
"shipping_descript
}
"27675":{
"entity_id":"27675",
"status":"complete",
"coupon_code":null,
"shipping_descript
},
"27676":{
"entity_id":"27676",
"status":"complete",
"coupon_code":null,
"shipping_descript
}
0
Comments
-
This is how my code.
APIResult := JsonConvert.SerializeObject(result);
APIResult := JsonConvert.DeserializeObject(APIResult,GETDOTNETTYPE(APIResult));
JProperties := JObject1.Parse(APIResult);
FOR i := 0 TO JObject1.Count DO BEGIN
END;0 -
Hi,
Below is an example, how to get list of properties of JsonObject:PROCEDURE ReadJsonString(JsonText : Text); VAR JObject : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject"; JProperty : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JProperty"; IEnumerable : DotNet "'mscorlib'.System.Collections.Generic.IEnumerable`1"; IEnumerator : DotNet "'mscorlib'.System.Collections.Generic.IEnumerator`1"; BEGIN JObject := JObject.Parse(JsonText); IF NOT JObject.HasValues THEN EXIT; IEnumerable := JObject.Properties; IEnumerator := IEnumerable.GetEnumerator; WHILE IEnumerator.MoveNext DO BEGIN JProperty := IEnumerator.Current; IF ISNULL(JProperty) THEN EXIT; MESSAGE('Name: %1\Value: %2', JProperty.Name, JProperty.Value); END; END;
0 -
Used to analyze two JAVA boolean articulations and return bogus on the off chance that both the boolean articulations are misleading, or, in all likelihood it returns valid assuming any of the boolean articulation is valid. A boolean articulation is an articulation that outcomes in a boolean worth - valid or bogus.
-1
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions