Closed CrackHub closed 1 week ago
if I set the path like this it works
as well as this works
so I guess this line is only referring to setting the json.path expression and not the relative path?
I think this is just a mistake in your events. In the not working version, you have For each entry in "Array". In the first iteration of that, the current path will be "Array.0". Then the sub-event does For each entry in ".0". Therefore that will iterate the path "Array.0.0", which is actually the string "Blue" and so it doesn't iterate it as it's a string and not an object or array.
So in the subevent you want something that means "the current path being iterated" rather than ".0" which means "the first array element in the current path being iterated". Using For each entry in JSON.Path is the correct way to do that.
Problem description
Cannot access nested arrays with "for each" in JSON.
Attach a .c3p
nestedJSONarray.c3p.zip
Steps to reproduce
Observed result
Return empty value
Expected result
Return array values in JSON.![image](https://github.com/Scirra/Construct-bugs/assets/54614906/c3b7965e-7652-4ac6-993f-9cd9547fd1fb)
More details
Affected browsers/platforms: Chrome
First affected release:
System details
View details
PASTE HERE