Hi,
I have an array aggregator. I’m trying to map each collection to a json structure and also add additional key/values to that.
I want my final output (in a set varaible mofule) to be:
{
“ManageRequests”: [
[
// All key/values from the array aggregator:
{ “key”: “Zip”, “value”: “72903” },
{ “key”: “City”, “value”: “Fort Smith” },
…
// add an additional key/value
{ “key”: “SubmissionActionCode”, “value”: “A” },
…
],
[
{ “key”: “Zip”, “value”: “90223” },
{ “key”: “City”, “value”: “New York” },
{ “key”: “SubmissionActionCode”, “value”: “A” },
…
]
]
}
I’ve tried:
{{map(1.array; merge(data;
{"SubmissionActionCode":"A";
"NotificationsEnabled":"Y";
"RemindersEnabled":"Y"
}
))
as well as:
{{map(14.Array; x; toArray(
add(x.data;
“SubmissionActionCode”; “A”;
“NotificationsEnabled”; “Y”;
“RemindersEnabled”; “Y”
)
))}}
as well as creating another set variable module with the key/values i want to add and then trying:
{
“ManageRequests”: [
{{map(14.array; “x”; toArray(merge(toArray(“x.data”); toArray(18.constants))))}}
]
}
see screenshots
anybody can point me in the right direciton? I’ve spent around 3 hours straight on this 
Thanks in advance
1 Like
Welcome to the Make community!
Please provide the output bundles of each of the relevant modules (module 14), by running the scenario (you can also get this without re-running your scenario from the History tab).
Click on the white speech bubbles on the top-right of each module and select “Download input/output bundles”.
A. Upload as a Text File
Save each bundle contents in a plain text editor (without formatting) as a bundle.txt file.
You can upload the file here by clicking on this button:

B. Insert as Formatted Code Block
If you are unable to upload files on this forum, alternatively you can paste the formatted bundles.
Here are some ways to provide text content in a way that it won’t be modified by the forum.
-
Method 1: Type code fence manually —
Add three backticks ``` in a separate line before and after the content, like this,
```
text goes here
```
-
Method 2: Highlight and click the “preformatted text” button in the editor —

-
Method 3: Upload your file and share the public link —
(this method is only recommended for large files exceeding the forum upload limit)
Providing the input/output bundles will allow others to replicate what is going on in the scenario, especially if there are complex data structures (nested arrays and collections) or if external services are involved, and help you with mapping the raw property names from collections.
This will allow others to better assist you. Thanks!
Hope this helps! Let me know if there are any further questions or issues.
— @samliew
P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!
Heyy @Daniel_W1, Have you tried using JSON aggregator for this usecase? It will allow you to add more keys in existing structure and based on new structure in json aggregator module you can map new values in newly defined structure.
May be this can help!
Best,
@Prem_Patel
Thanks for the suggestion!
I ended up starting again from scratch and did use a json aggregator in the scenario. I broke up the data in more steps and managed to get what I needed.
1 Like