Issue with JSON and Xero Module

Hi everyone,

I’m trying to gather all items in a group on Monday and send them to Xero through one invoice (a line item per item on the board).

I am generating JSON for the line items:
Screenshot 2024-05-28 at 16.26.54

But when I send this to Xero I get the following error:
Screenshot 2024-05-28 at 16.27.19

Sending it through Xero like the below:
Screenshot 2024-05-28 at 16.27.54

Can anyone please help me in telling me where I’m going wrong?

Thanks so much!

Welcome to the Make community!

You need to insert a single array of line items, not a JSON string of line items.

Use the Array Aggregator to build an array from multiple bundles.

Every result (item/record) from a search/match module will output a bundle. To “combine” them into a single structure, 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 Array Aggregator module also allows you to build a complex array of collections for a later module’s field to map multiple items (collections) to it.

Here is an example of using the “Target structure type” of an Array Aggregator module:

As you can see, the “Map” toggle on fields are used when you have an array. You can easily build an array variable to map to a field, by using an Array Aggregator module and select the “Target Structure Type” as the future field you want to map the array into.

samliewrequest private consultation

Join the unofficial Make Discord server to chat with us!

3 Likes