Adding line items dynamicaly to a Bill in Quickbooks

Hi guys,

I’m looking to dynamically add line items (fig.1).

I figured I need to map that field with an array.

So I’m using an iterator to get the data I need for each items, and then I though using an array aggregator to make an array of the items.

But the aggregator gives the bundles seperatly, thus completely useless (fig.2).

I think I need an array of array? because as of now it’s not adding line items but replacing it everytime.

Thanks in advance for your help.

First thing is you need to toggle the map switch. Next figure out the structure of the JSON needed for that field. Then you can use a text aggregator or JSON aggreagtor to build out the required mapping with the right format.

One way to find the structure is to enter in the values manually and run the module. Then take a look at the input of that run and find the field your trying to map. You need to then copy the JSON structure with your values mapped using a agregator.

Another way to find the structure is to look over the API docs.

Hope this helps!

You simply 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.

Here is an example:

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.

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!

2 Likes

Yes that was it, the source from my aggregator was the Airtable get record module, instead of the iterator. That works like a charm now!

1 Like