first of all, your json is not valid.
- json doesn’t have left quotations marks and right quotation marks (your sample does). Json uses only the quotation mark for both opening and closing a string.
- json usually starts with a non-array item, not an array (like your sample does)
- every opening quote and brace should have a matching ending quote and brace - your sample doesn’t meet these conditions because you just decided to cut-n-paste a segment and missed the beginning and end of the whole json string.
- the json string is not “quoted” properly for viewing . Next time you want to share some json code or program code or parameter data, etc, in our thunkable forum, please highlight it and click the preformatted icon
anyway, i went ahead and corrected your json so it looks like this - i made the PENDING array part of the object called root;
{"root":{
"PENDING": [
{
"AMOUNT": 150.6,
"ID": 872228,
"NAME": "Aman Abdul Khalek 1 - ABJ"
},
{
"AMOUNT": 80,
"ID": 817901,
"NAME": "Mahi uddin 1 - ABJ"
},
{
"AMOUNT": 154,
"ID": 1745803,
"NAME": "Dipesh Kalal Natwar Lal Kalal 1A - ABJ"
}]}}
after you get a json string, paste it to this website https://jsonbeautify.com/ to see its structure (and also validate the format)
this is what your json really looks like:
{
"root": {
"PENDING": [
{
"AMOUNT": 150.6,
"ID": 872228,
"NAME": "Aman Abdul Khalek 1 - ABJ"
},
{
"AMOUNT": 80,
"ID": 817901,
"NAME": "Mahi uddin 1 - ABJ"
},
{
"AMOUNT": 154,
"ID": 1745803,
"NAME": "Dipesh Kalal Natwar Lal Kalal 1A - ABJ"
}
]
}
}
in order to get the AMOUNT that Dipesh owes, code the following:
the join block is actually forming the concatenated key/property
root.PENDING[3].AMOUNT
in order to find out how many items are in the PENDING array, you would code this:
good luck!