I am working on a complex project where after doing all the courses and thinking for a few days I still can not come up with a solution. Therefor I am hoping you guys can help out.
What I want to achieve:
First Visma (accounting software) API looks for bankaccounts, second API should see how many banktransactions per bankaccount are not matched with an invoice (this works). Then I want it to calculate (sum) it to a total of all unmatched banktransactions for all the bankaccounts combined and put the outcome in a google sheets cell.
The iterator provides the info to the second Visma API where it outputs the unmatched transactions per bankaccount.
What is going wrong:
I get the bankaccounts, I get the unmatched transactions but I don’t get them to calculate up. For example in this run it detected 9 bankaccounts, so it will just update the cell 9 times. Instead of adding up the total and putting that in the cel.
I tried a lot, but I believe it needs an array aggregator, sadly I don’t get it to work. I put the array aggregator between the second Visma API and the nummeric aggregator. As input I took the second Visma API. But also tried as input the Iterator, but that did not work because it only contains info from the first Visma API.
You need to set the “Source Module” field of the aggregator to where the bundles are coming from. This is usually an Iterator module, but can also be a search/list/repeater module.
For more information, please refer to the Make Academy.
Aggregators
Every result (item/record) from iterator/list/search/match modules will output a bundle. This can result in multiple bundles, which then trigger multiple operations in future modules (one operation per bundle). To “combine” multiple bundles into a single variable, you’ll need to use an aggregator of some sort.
Aggregators are modules that accumulate multiple bundles into one single bundle. An example of a commonly-used aggregator module is the Array aggregator module. The next popular aggregator is the Text Aggregator which is very flexible and can apply to many use-cases like building of JSON, CSV, HTML.
There are other types of aggregator modules, click the below links to find out more:
Array Aggregator – mapping multiple bundles into a complex field
The Array Aggregator module is very powerful because it allows you to build a complex array of collections for a later module’s field to map multiple items (collections) to it.
This is done using the “Target structure type” of an Array Aggregator module.
As you can see, the “Map” toggle on complex fields are used when you have an array. You can easily build an array variable to map to a future module’s field, by using an Array Aggregator module and select the “Target Structure Type” as the future module’s field you have mapped the array into.
Hope this helps! Let me know if there are any further questions or issues.
I have added an Iterator and an array aggregator to fix this. Unfortunately now the Visma API only runs once, instead of 9 times for the 9 bankaccounts.
It doesn’t run once - it ran and halted on the first bundle due to an error, and the rest of the bundles couldn’t complete.
What is the new error now?
To allow others to assist you with your scenario, please provide the following:
Relevant Screenshots
Please share screenshots of your scenario, any error messages, relevant module fields, and relevant filter settings. 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:
Scenario Blueprint
Please export the scenario blueprint file to allow others to view the mapped variables in the module fields. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.
Please provide the output bundles of the modules by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.
Save each bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.
B. Insert as Formatted Code Block
If you are unable to upload files on this forum, alternatively you can paste the formatted bundles.
These are the two ways to format text so that it won’t be modified by the forum:
Method 1: Type code block manually
Add three backticks ``` before and after the content/bundle, like this:
``` content goes here
```
Method 2. Highlight and click the format button in the editor
Providing the input/output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.
By providing these details, it will allow others to assist you better.