Tracking Category Options not visible in Line Items Structure

:bullseye: What is your goal?

I want to use the Array Aggregator to send multi line items to the Xero Create Invoice Module, with Tracking Categories.

:thinking: What is the problem & what have you tried?

Problem:
The Tracking Category Name and Option is available in the Xero Create Invoice module.
This works well for single line entries, but I am using an Iterator-Aggregator to enter multiple Line Items, sending the Line Items as an Array to the Create Invoice Module.
Only the Tracking Name field is available when the Array Aggregator maps to the Xero Create Invoice Target Structure?

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

Welcome to the Make community!

In that case you might need to use an Array Aggregator to prepare the entire array of category items instead.

Use the parent map toggle on the Tracking field.

Mapping a Specific Structure Into a Complex Field

If you have an array of collections, in programming terms, this is called an array of objects, or an array with non-primitive data types (“complex”).

The Array Aggregator module is very powerful because it allows you to build a new complex array of collections that matches a later module’s field to map multiple items (collections) to it. Such fields initially would allow you to manually add items, but you can toggle the “Map” switch to the “on” state and map a whole array into a single field.

This is done by selecting the “Target structure type” in an Array Aggregator module.

As you can see from the above example, the “Map” toggle on complex fields are used when you have an array variable (like from an array aggregator). Other combinations of modules may also allow you to generate an array that matches a future field’s array structure, like “Aggregate to JSON + Parse JSON”, or “Create JSON + Parse JSON”, but this is an advanced topic.

Question: Are you mapping your array into a field that accepts more than one item/collection?

Example

Here is an example of how your scenario could look like to build the “Tracking” array:

This is just an example. Your final solution may or may not look like this depending on your requirements and actual data.

For more information, see “Mapping with arrays” in the Help Centre. You should also do the Make Academy, which also covers the use of Iterators & Aggregators.

Hope this helps! If you are still having trouble, please provide more details.

— @samliew
P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!

Hi, thanks for your quick assistance. I will experiment and let you know how I get on.

Hi,

I have solved the issue with your help. The Xero Tracking map expects an Array that includes both the Name & Option. I used a Parse JSON module to create the array and mapped it to the Array Aggregator Tracking map field.

3 Likes

No problem, glad I could help with "Tracking Category Options not visible in Line Items Structure"!

:slight_smile:

If you have a follow-up question, please start a new thread.

— @samliew