Invoice from clickup

Hi everyone,

We’re trying to build a Make scenario that:

Fetches tasks from ClickUp (Watch Tasks/Get a Task modules). Uses Array Aggregator to group tasks by a custom field NIP X. In an HTTP module, we create a JSON that merges tasks into a positions array. Each unique NIP should produce a single “invoice” with multiple positions. We’re having trouble using the map() function in the JSON body. We keep getting errors like:

Failed to map ‘data’: Function ‘map’ finished with error! ‘[object Object],[object Object]{“name”’ is not a valid array. or

422 Unprocessable Entity - “You must add at least one position.” Our logs show that sometimes positions is empty ([ ]) or incorrectly formatted ([{{, }}]) in the final JSON request. Despite correctly configuring the Array Aggregator (it does return the grouped tasks with the Key = NIP and an array[ ] of tasks), the final JSON still breaks.

What we tried:

Using the syntax map(52.array[ ]; “key1”; value1; “key2”; value2; …) as recommended. Verified that aggregator output is correct (we see the tasks and custom fields in the log). Yet the HTTP module ends up generating [{{, }}] instead of [ {…}, {…} ]. Scenario flow:

Watch/Get tasks from ClickUp → 2) Array Aggregator (Group by NIP) → 3) HTTP module with JSON body “positions”: [ {{ map(…) }} ]. But in practice the final JSON comes out malformed, leading to a bad request or empty positions. Question: What might be causing these JSON map() issues? Is there a particular module configuration we’re missing? Should we add an extra “Set Variable” step to produce the JSON first, then feed it to HTTP?

NIP X=tax_no=key

Input Array Aggregator.txt (2.3 KB)
Output Array Aggregator.txt (2.9 KB)

Thanks in advance for any help!