Key concepts
Tools

Iterator

7min
iterator is a special type of module that converts an array into a series of bundles each array item will output as a separate bundle setting up an iterator setting up an iterator is done in the same way as module settings docid\ vnbss belmdin3d4gguxl the array field contains the array to be converted/split into separate bundles examples save email attachments to google drive the {{scenario singular lowercase}} below shows how to retrieve emails with attachments and save the attachments as single files in a selected google drive docid\ ct1o6esjm1f0xm3wk5nbx folder emails can contain an array of attachments the iterator module inserted after the first module enables you to handle each attachment separately the iterator splits the array of attachments into single bundles, each bundle with one attachment will then save one at a time in a selected google drive folder the iterator module set up is shown above the array field should contain the attachments\[] array specialized iterators for your convenience, many {{product name}} apps offer specialized iterator modules with a simplified setup for example, the docid\ minmgwoe1 i9v0yvmhkzm app contains the special iterator email > iterate attachments that will produce the same results as the general iterator without having to specify the array, just the source module learn when to use an iterator in your {{scenario plural lowercase}} the video below is module 1 of the 3 part lesson titled iterator and array aggregator it explains the purpose of the iterator and the array aggregator and with the help of a sample {{scenario singular lowercase}} , explains when to use an iterator and what to do with the output youtube link here https //www youtube com/embed/mwzba2xsvb4 troubleshooting mapping panel does not display mappable items under the iterator module when an iterator does not have information about the structure of the array's items, the mapping panel in the modules following the iterator will display only two items under the iterator total number of bundles and bundle order position the reason for this is that in {{product name}} each module is responsible for providing information about items it outputs so these items can be properly displayed in the mapping panel in the following modules however, there are several modules that might be unable to provide this information in some cases, e g docid 2zexwuohei0yvsoeq2nag > parse json or docid 1yhunj8jvzyxip9cf3ps1 > custom webhook modules with missing data structures docid 1eokqdvoyet82um5djja8 the solution is to manually execute the {{scenario singular lowercase}} to make the module learn about the items it outputs so it can provide the information to the following modules for example, if you have a json > parse json module without a data structure as below and then if you connect an iterator module to it, you will not be able to map the output of the module to the array field in the setup panel of the iterator to resolve this, just manually start the {{scenario singular lowercase}} in the {{scenario singular}} editor you can un link the modules after the json > parse json module to prevent the flow from proceeding further or right click the json > parse json module and choose "run this module only" from the context menu to execute only the json > parse json module once the json > parse json has been executed, it learns about the items it outputs and provides this information to all the following modules including the iterator the mapping panel in the iterator's setup will then display the items flow control 10 png moreover, the mapping panel in the modules connected after the iterator will display the items contained in the array's items in summary if you cannot see some items in a module's mapping panel, simply run the {{scenario singular lowercase}} once so all the modules can learn about the items they output and provide this information to the following modules