You need to sign in to do that
Don't have an account?
salesforcequestions123
parsing sting urgent
hi this is the format i am getting response can u parse this format and help me
{
"Success": "true",
"Assessments": [
"AssessmentID": "123456",
"AssessmentName": "Demo Assessment",
"AssessmentType": "Test",
"CostPoints": "1",
"NumberOfQuestions": "35",
"TimeLimit": "2100"
]
}
to retrieve the 6 values only when success is true
Hello!
That String over there looks like a JSON. Check out salesforce's JSON parser classes:
http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#CSHID=apex_methods_system_json.htm|StartTopic=Content%2Fapex_methods_system_json.htm|SkinName=webhelp
Thanks,
Adrian
Hi
Actually my json string is not in standard format to json parse it.How can i onvert the string with tkens do i can acess individual elements like accesseries id,aand others
Hi
The incorrect json part of your string is that the array elements should be engulfed in curly bracets, as such:
if you can get the response in proper json like above, then you can use the following class and the standard force.com JSON parser:
Cheers