List Key of Json

Hello,
I have a JSON, and I would like to list all key of items there are here, not the value of an element, but the key, there is a manner to do this?
Thank

cut n paste a copy of the returned json string and post it here - firstyou highlight it and apply the pre-ormatted text option on it (see option in gear icon) and post the raw json text here and we will see what approach to take below is an example.

{"type":"bar","data":{"labels":["Q1","Q2","Q3","Q4"],"datasets":[{"label":"sales","data":["91","60","70","100"]},{"label":"profit","data":["78","80","78","90"]}]},"options":{"scales":{"yAxes":{"stacked":true},"xAxes":{"stacked":true}}}}

I don’t know if is that you want, but, this my json:

{
	"user_id": {
		"class": {
			"lessons": {
				"class_name": {
					"student 1": {
						"time": 0,
						"answers": "1,2,3,4"
					},
					"student 2": {
						"time": 0,
						"answers": "1,2,3,4"
					},
					"student 3": {
						"time": 0,
						"answers": "1,2,3,4"
					},
					"student 4": {
						"time": 0,
						"answers": "1,2,3,4"
					}
				}
			}
		}
	}
}

what kind of list are you expecting to receive?

I Would like to receive first in a list (list viewers object) list of lessons, next list of classes, and to finish, to show list of students who send their data

Please @manyone

like this?

here are the blocks

the outcome is a text so you should run it thru the list_from_text block using delimiter “|” to get a list.

i also cheated - i already know what names are the various columns so i hardcoded the property values

https://x.thunkable.com/copy/e1ab4a41276e3f8950dcf74ce1c7c8b5

It looks like it requires a recursuve solution, which i s difficult for me to arrive at at this time.

Maybe someone else may find the recursive answer easily.

2 Likes

No, I would like Thunkable show a list viewer of different lessons, next user click, show list of different class, user pick one, and it show a table of different value of each students

User_id it is the identifiant of user by firebase and first “class” key it’s to sey that you need to get these value

I’ve given you most of the tools you’ll
need. The first item in the list builder block returns the classes for a user_id. Just put them in a list viewer.
After pick an entry, goto a new screen where there’s a new list viewer whose elemenr entriesc are from the 2nd item in my.list builder block, etc. Doi the same process for the remaining levels.
Hint. Include the “path” ( eg. User_id…class…lessons… ) at the top of every screen and append the current elemenr to the new path in the next screen. Note; the path is the string that appears in get_property block. Good luck!

1 Like

Thank, get_propriety block work perfectly
Thank you very much

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.