Help Creating JSON Structure

What are you trying to achieve?

I’m trying to take a basic array that just contains URLs and create a JSON object which is an array that contains collections where each collection inside that array is populated with my image URL along with another static field that will be the same value for every entry.

I’m trying to go from this basic array:

Bundle 1 (Collection)
imageSrcArray (Array)
1 URL #1
2 URL #2
3 …

to this structure:

[
{
“imageSrcCollection”: [
{
“image_url”:“URL #1”,
“param_type”:“IMAGE”,
},
{
“image_url”:“URL #2”,
“param_type”:“IMAGE”,
}
]
}
]

Steps taken so far

Newbie here. I have done quite a few other modules successfully in my automation including AI JSON structures I’ve created, setting variables, API calls, reading and writing to Excel, etc. But I cannot for the life of me figure this out. I’ve probably spent hundreds of ops and tons of time watching YouTube videos trying to figure this out. I’m hoping someone can talk to me like I’m 10 years old and over-simplify it for me!

I have an array that I’m populating using “array add()”. It’s just a basic array that contains image URLs. So every time I call “add()” I’m just adding a image URL. I can have any number of URLs, not just two. Just using two for this example.

Bundle 1 (Collection)
imageSrcArray (Array)
1 URL #1
2 URL #2
3 …

I’m trying to take each one of those URLs and create a JSON structure that looks like below. So it would be an array containing collections.

I cannot figure out how to loop through my imageSrcArray and then create an array that contains two collections out of that where those two collections are inside of the “imageSrcCollection” array. I’m pretty sure I’m supposed to do this using JSON modules, but I’m just lost.

Thanks for any help and/or direction you can provide!

[
{
“imageSrcCollection”: [
{
“image_url”:“URL #1”,
“param_type”:“IMAGE”,
},
{
“image_url”:“URL #2”,
“param_type”:“IMAGE”,
}
]
}
]