I want to select the main objects like place1 and place2. It can be more than two. So it should work dynamic.
Hope somebody can help how I can do this.
I’m not sure what you posted above is valid JSON. I tried a bunch of JSON validators online and they all returned errors. Can you copy the entire result from the web and paste it here? Are you using a third-party API or your own server?
Edit: just saw your response. Yep, it was the quotes.
I honestly think it might be the smart quotes that are messing things up. Because I constructed a JSON string using the same data and it looks identical except for the quotes… and it is valid JSON:
Hmm… I’ve never created my own JSON so I’m struggling a little bit here. But I think you’ve attempted to create a JSON array but without brackets [ ]. I’m not sure how to fix it but I’m trying a few different formats to see what might work.
Just a couple of weeks ago, I discovered that the ARRAY (aka List) in JSON was a later addition to JSON (5. Arrays, Objects, Functions and JSON - Mixu's Node book). Using Properties with names like place1,place2, place3, etc. feels a bit peculiar for me, who learned JSON through Thunkable.
To loop through properties which are treated like a list, you can use the following loop structure:
Notice the loop is through the PROPERTIES of the object, not the object itself (like when the object is an array (as in tatiang’s example). Then if you want to get the object, you need to use the Get Object Property Block.
It feels a bit pecular, but it has some advantages. One big advantage is that you can reference objects in a list by NAME, rather than having to loop through the list to find it. One big disadvantage is that the order is dependent on the object name.