aspjson icon indicating copy to clipboard operation
aspjson copied to clipboard

empty primary key

Open pokolokatepetl opened this issue 3 years ago • 1 comments

I have a json string:

[{"file":"78jsyhpg9mtf.jpg"},{"file":"imqk2680ra4p.jpg"}]

that doesn't have primary object name. It is accessible via data(0)...

But how do I iterate with for next loop over all elements in collection?

Using

Set oJSON = New aspJSON for each file in oJSON.data() ... next

obviously doesn't work. And I can not use oJSON.data("name") as the collection does not have primary data object.

How can I iterate or at least find the number of records, so I could use for next with x=0 to number of records?

pokolokatepetl avatar May 05 '21 02:05 pokolokatepetl

I had the same problem, try

Dim i
For Each i In oJSON.data.Items
    response.write i.item("file") & "<br>"
Next 

photoangell avatar Nov 29 '21 18:11 photoangell