Arrays Missing Dates

:bullseye: What is your goal?

Get Missing Dates and Create an Array of Missing Days and Join with Original Array

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

I want to achieve below. I have an array in this structure:
[
{
“segments_date”: “2025-12-01”,
“metrics_costMicros”: “8968591”
},
{
“segments_date”: “2025-12-02”,
“metrics_costMicros”: “7980000”
}
]

Now as come may be aware if the cost is zero Google Ads doesnt include that date in the result. This is resulting in breaking my automation. So I build an array with Available Dates. (Attached Screenshot). Is there a away i can identify missing dates in this case 12 ,14 and then create and array like this:
[
{
“segments_date”: “2025-12-12”,
“metrics_costMicros”: “00.00”
},
{
“segments_date”: “2025-12-14”,
“metrics_costMicros”: “00.00”
}
]

And then join both the arrays and sort by date so that my automation doesnt break.

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

1 Like

Hey there,

is the report monthly or something? I mean is it a fixed period that is always the same?

They you can prebuild an array of all the dates of the month, use the map() function to find the missing ones and merge them with the existing array.

If you want it dynamic with a different input range, then it will be a bit more tricky.