Iterator module: How can i force the flow to continue when output of Iterator is 0

Hey!
So I have a flow that take in 2 arrays. One array with Costs and one array with Investments.
These 2 arrays are looped so I can upload some files that are linked with this data. with an Iterator module I tried to achieve this.

The issue I am running into is that an array is empty sometimes. Which results in the Iterator outputting notthing, so the flow does not continue.

{{ifempty(1.fin_geg.investments; add(“, 1”))}}

This is the solution I have tried. But this also give me an empty array. How can I improve this statement so ifemtpy give me a hardcoded array so at least the flow can continue.

Thanks

Welcome to the Make community!

You can try

{{ ifempty(array; emptyarray) }}

Otherwise this should also do the same thing

{{ if(length(array) > 0; array; emptyarray) }}

Alternatively, you can get Make to ignore the field (only if it is not a required field)

{{ ifempty(array; ignore) }}

samliewrequest private consultation

Join the Make unofficial Discord server!

1 Like

Could you be more specific on the emptyarray? How can I define an emptyarray in make.

I have tried

{{ ifemtpy(array; [1]) }}

But this did also not work

You either copy and paste exactly what I provided,

Or type

{{emptyarray}}

Or select it from the variables panel.

samliewrequest private consultation

Join the Make unofficial Discord server!

1 Like

Thanks. But correct me if im wrong, but an {{emptyarray}} will stop my Iterator from continuing the flow? What I need is an array with one element so it does the loop at least 1 time.

For further assistance, please provide the following:

1. Screenshots of module fields and filters

Please share screenshots of relevant module fields and filters in question? It would really help other community members to see what you’re looking at.

You can upload images here using the Upload icon in the text editor:
Screenshot_2023-10-07_111039

2. Scenario blueprint

Please export the scenario blueprint file to allow others to view the mappings and settings. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.

Screenshot_2023-08-24_230826
(Note: Exporting your scenario will not include private information or keys to your connections)

Uploading it here will look like this:

blueprint.json (12.3 KB)

3. And most importantly, Output bundles

Please provide the output bundles of the modules by running the scenario, then click the white speech bubble on the top-right of each module and select “Download output bundles”.
Screenshot_2023-10-06_141025

A.

Save the bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

Uploading it here will look like this:

bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted output bundle in this manner:

  • Either add three backticks ``` before and after the code, like this:

    ```
    input/output bundle content goes here
    ```

  • Or use the format code button in the editor:
    Screenshot_2023-10-02_191027

Providing the output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

Following these steps will allow others to assist you here. Thanks!

samliewrequest private consultation

Join the unofficial Make Discord server to chat with us!

1 Like