You need to sign in to do that
Don't have an account?
![Srikar Reddy Srikar K Srikar Reddy Srikar K](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Need hierarchial json and how to read that in Apex.
Hi ALl,
My Json is similar to below, need help to read the below in Apex:
{
"ideal":
{
"product":"4",
"percent":"25",
"dollarAmount":"11250"
},
"idealFiltered":[
{
"Type":Child1
"dollarAmount":"11250",
"InBudget":[
{
"percent":"70",
"dollarAmount":"7000"
},
{
"percent":"30",
"dollarAmount":"3000"
}
]
},
{
"Type":Child2
"dollarAmount":"11250",
"InBudget":[
{
"percent":"80",
"dollarAmount":"8000"
},
{
"percent":"40",
"dollarAmount":"4000"
}
]
}
]
}
Thank you, Srikar
My Json is similar to below, need help to read the below in Apex:
{
"ideal":
{
"product":"4",
"percent":"25",
"dollarAmount":"11250"
},
"idealFiltered":[
{
"Type":Child1
"dollarAmount":"11250",
"InBudget":[
{
"percent":"70",
"dollarAmount":"7000"
},
{
"percent":"30",
"dollarAmount":"3000"
}
]
},
{
"Type":Child2
"dollarAmount":"11250",
"InBudget":[
{
"percent":"80",
"dollarAmount":"8000"
},
{
"percent":"40",
"dollarAmount":"4000"
}
]
}
]
}
Thank you, Srikar
Hi Srikar Reddy Srikar K ,
please find the solution
This tool will parse the json for you and create a class
http://json2apex.herokuapp.com/
If you find this solution is helpful for you please mark the best answer