Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- General Development
- :
- How to deserialize the JSON response with dynamic ...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
How to deserializ e the JSON response with dynamic data ????
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-31-2013 01:21 PM
Hi All,
I am using JSON.deserialize(JSONResponse, Sample.class) method for parsing
Below is the sample
public class Sample{
public String a {get;set;}
public String b {get;set;}
public String c {get;set;}
public String d {get;set;}
public Sample1 test {get;set;}
public Sample1{ // in response, for this class dont know about the fields. in each and every response the fields are changing.
}
}
How to handle such response using JSON.deserialize and store it in Apex class variable?
Response :- 1
{
"a": "Sometext",
"b": "Sometext",
"c": "Sometext",
"d": "Sometext",
"test": {
"Data1": {
"score": 2
},
"Data2": {
"score1": 1
},
"Data3": {
"score1": 2
}
}
}
Response :- 2
{
"a": "Sometext",
"b": "Sometext",
"c": "Sometext",
"d": "Sometext",
"test": {
"Data50": {
"score12": 2
}
}
}
Any pointer's on this would be highly appricate.
Thanks in Advance.
Re: How to deserializ e the JSON response with dynamic data ????
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-03-2013 10:05 PM
I am facing the same problem.Have you find any solution?

