I am saving coordinates to a field (“coordinates_text”) in a Data Type called “Map_Area”. Each User has an assigned map_area which is of type “Map_area”. Is there a sure way to get all users then get their map_area then get their coordinates.
instance.data.users = properties.users.get(0, properties.users.length()); instance.data.users.forEach(function(user){ user.get(properties.map_area).get(properties.coordinates); });
For some reason this does not work. If I remove the .get(properties.coordinates) and put listProperties() then I can see the coordinates field but as soon as I try to get it then nothing happens. I have successfully done this with loading user’s nested images but in order to get that to work I had to put an unused ‘Search for Users’ on the element and loop through all the Users twice while pulling their images. Is there a best practice for pulling nested data types in the plugin builder?
For some reason it worked perfectly when I did this instead.
instance.data.users = properties.users.get(0, properties.users.length()); instance.data.userObjects = []; instance.data.users.forEach(function(user){ let newUser = { area: user.get(properties.map_area).get(properties.coordinates) }; instance.data.userObjects.push(newUser) });