Issue iterating through nested array of objects

I am trying to create a form that I have built in infinity to then be posted onto my site. The issue that I am facing is that, I am not correctly iterating through the data into “distributorList” to retrieve the “distributorID”. Using make, how can I go into the form data and retrieve the ID? I’ve tried using toCollection() as well as map() and flatten() to no avail. Any help with this would be greatly appreciated. Thanks.

Hi @JR1 and welcome to make community
please attach a photo of the module id 3 output

2 Likes

Hi @Dorian_Ben_Haim, I am assuming module id 3 are the values from the “3.values” array. Let me know if this helps any.


working backwards I was able to format the object correctly. Just not the correct information

in the map function you never access to the attribute id since its nested in the attribute collection
try to replace the attribute_id with attribute.attribute_id in the map function

3 Likes

Thank you for the help @Dorian_Ben_Haim, your suggestion worked to inside of the nested array! The issue now is that the input being given is an array, which is partially correct. For the form to work the correct way, I need help nesting an object (collection) into the array. Any help would be greatly appreciated.