Examples:
-
The below scenario shows how to retrieve emails with attachments and save the attachments as single files in a selected Dropbox folder.
Emails can contain an array of attachments. The Iterator module after the first module enables the scenario to handle each attachment separately. The Iterator module splits the array of attachments into single bundles. Each bundle, with one attachment, is then saved one at a time in a selected Dropbox folder. The Array field in the Iterator module should contain the
Attachments
array.
Troubleshooting
Problem: Mapping panel does not display mappable items under Iterator module
When an Iterator module does not have information about the structure of the array’s items, the mapping panel in the modules following the Iterator module displays only two items under the Iterator module: Total number of bundles
and Bundle order position
.
This is because each module is responsible for providing information about items it outputs, so that these items can be properly displayed in the mapping panel in the subsequent modules. However, several modules might be unable to provide this information in some cases. For example, JSON > Parse JSON or Webhooks > Custom Webhook modules with missing Data structure would not provide the information.
Solution
The solution is to manually execute the scenario. This forces the module to create output. Fusion can then apply the format of this output to later modules in the scenario.
For example, a scenario includes a JSON > Parse JSON module without a Data structure.
An Iterator module connected to this JSON module cannot map the output of the module to the Array field in the setup panel of the Iterator module.
To resolve this:
Manually start the scenario in the scenario editor.
- Unlink 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.
After the JSON > Parse JSON executes, it can then provide information about its outputs to all the subsequent modules, including the Iterator module. The mapping panel in the Iterator’s setup then displays the items:
in addition, the mapping panel in the modules that are connected after the Iterator module display the items contained in the array: