Hello all, I have a feeling I overcomplicated this for myself so I will spare you the details of what I have tried and go to basics…
I have a custom module that parses an HTML to output a collection with two arrays and a number of strings.
The output is:
[
{
“sender”: “John Sender”,
“senderEmail”: “jsender@example.com”,
“recipient”: “James Recipient”,
“orderName”: “My Order Name - Amazing Product Model 001”,
“dueDate”: “09/22/2025”,
“region”: “EMEA”,
“productLine”: “Amazing Products Basic Line”,
“targetLanguages”: [
“Croatian hr_HR”
],
“assetsSpecifications”: “No”,
“instructions”: “No”,
“videoSpec”: null,
“assetsShared”: [
“AmazingProd_Combo_705_Auto_Cleaning_White_Sell_Sheet_EMEA_X185240.pdf”,
“AmazingProd_Supreme_705_Combo_AutoCleaning_OnProduct_Graphic_Merchandising_White.pdf”,
“AmazingProd_Supreme_705_Combo_AutoCleaning_White_Caption_4Stage_4000x4000.psd”,
“AmazingProd_Supreme_705_Combo_AutoCleaning_White_Hotspot_Amazon_Desktop_1464x600.psd”,
“AmazingProd_Supreme_705_Combo_AutoCleaning_White_Photo_InSitu_Caption_Suction_4000x4000.psd”,
“AmazingProd_Supreme_705_Combo_AutoCleaning_White_Photo_InSitu_DockSummary_Caption_4000x4000.psd”,
“AmazingProd_Supreme_705_Combo_AutoCleaning_White_Photo_InSitu_Exclusive mop cover_Caption_4000x4000.psd”,
“AmazingProd_Supreme_705_Combo_AutoCleaning_White_Photo_InSitu_HeatedMopping_SmartScrub_Caption_4000x4000.psd”,
“AmazingProd_Supreme_705_Combo_AutoCleaning_White_Photo_InSitu_LiDAR_Caption_4000x4000.psd”,
“AmazingProd_Supreme_705_Combo_AutoCleaning_White_Photo_InSitu_PrecisionVision_Caption_4000x4000.psd”,
“AmazingProd_Supreme_705_Combo_AutoCleaning_White_ProductOverview.mp4”
]
}
]
I need to pass some of this data into a custom app, which is making an HTTP call and among other things in the body needs to pass a section called customFields that will take a json structure of type:
"customFields": \[
{"key": "Asset_Delivery_Specifications_yihatv",
"value": "No"},
{"key": "Asset_Names_xh7jvt",
"value":"AmazingProd_Combo_705_Auto_Cleaning_White_Sell_Sheet_EMEA_X185240.pdf, AmazingProd_Supreme_705_Combo_AutoCleaning_OnProduct_Graphic_Merchandising_White.pdf, etc…"},
…..
\],
The keys in this json structure could change, so I would ideally like to have a module where they are defined and set up and I would also like to define which data from the collection goes with which key.
At the end, I would just like to add this to the payload of the API call, but I cannot fully figure out the best way of doing that
