Make noob here and i’m struggling in finding a way to merge two arrays into a single array with nested arrays (each is a nested two element array consisting of the values at the corresponding index from the original two arrays). My use case is I am generating a Gantt chart with date ranges and I need the date ranges formatted this way so the QuickChart api module can parse correctly. Here is what I am working with the multiple variables I have created.
Example Input Arrays:
startDates: ["06-01-2024", "07-10-2024", "08-15-2024"]
endDates: ["06-08-2024", "07-19-2024", "08-28-2024"]
Example Desired Output:
mergedDateRanges: [
["06-01-2024", "06-08-2024"],
["07-10-2024", "07-19-2024"],
["08-15-2024", "08-28-2024"]
]
Here is the actual data I have on my Tools : Set Multiple Variables module after my Array Aggregator:
Actual Bundle Output:
[
{
"startDates": [
"2024-06-12T23:00:00.000Z",
"2024-06-12T23:00:00.000Z",
"2024-06-17T23:00:00.000Z",
"2024-06-16T23:00:00.000Z",
"2024-06-19T23:00:00.000Z",
"2024-04-30T23:00:00.000Z",
"2024-06-18T23:00:00.000Z"
],
"endDates": [
"2024-06-09T23:00:00.000Z",
"2024-06-09T23:00:00.000Z",
"2024-06-09T23:00:00.000Z",
"2024-06-09T23:00:00.000Z",
"2024-06-12T23:00:00.000Z",
"2024-04-18T23:00:00.000Z",
"2024-05-02T23:00:00.000Z"
]
}
]
If I could use JS I could easily accomplish this with a for loop but I’m struggling to find a way to make this all work without using something like CustomJs (which im hoping not to use). Any insight here is hugely appreciated!