Hey Make Community!
I hope you’re all doing well! I’m working on a project where I need to extract information from a WordPress website form into a structured JSON array, and I’m really hoping to get your help to figure out the last piece of the puzzle.
Here’s What I’m Trying to Do:
I’ve got a WordPress form that users fill out, which includes a list of products with various specifications. The tricky part is that all the product information is grouped together in a long text string under the field "your-order"
. My goal is to take that data, parse it, and turn it into a neat JSON structure like this:
{
“firstName”: “John”,
“lastName”: “Doe”,
“telephone”: “1234567890”,
“email”: “john.doe@example.com”,
“company”: “ExampleCorp”,
“address”: “123 Example Street”,
“city”: “ExampleCity”,
“state”: “ExampleState”,
“order”: [
{
“productType”: “Window”,
“productName”: “Model X Hinged Window”,
“corners”: “Mitered”,
“paint”: “Silver”,
“glassTint”: “6mm 1/4" 44% grey”,
“windowType”: “N/A”,
“width”: “45”,
“height”: “32”,
“quantity”: “2”
},
{
“productType”: “Door”,
“productName”: “Model Y Insulated Door”,
“corners”: “4" Radius”,
“paint”: “Black”,
“glassTint”: “6mm 1/4" 44% grey”,
“windowType”: “Slider”,
“width”: “56”,
“height”: “78”,
“quantity”: “1”
}
]
}
The amount of ordered products may vary, so that’s another tricky part for the JSON structure.
What I’ve Accomplished So Far:
- I’ve successfully parsed the
"your-order"
data using Make’s text parser modules, and I can now extract the product information into an array. - Each product’s details (like type, name, dimensions, etc.) are now neatly organized into individual elements.
Where I’m Stuck:
I’m having trouble combining everything into a final JSON structure that includes both:
- The general customer details (first name, last name, etc.).
- The array of products, where each product’s details are correctly organized as individual objects.
The final JSON needs to look like the example above, with the "order"
array dynamically handling 1 to many products.
What I’m Looking For:
I’d be super grateful for any advice, tips, or guidance on how to create this complete JSON structure, especially the part where I bring together the customer details with the dynamically generated product array.
Thank you all so much in advance—I really appreciate any help you can offer! I’ll be adding some screenshots to show what I’ve done so far and where I’m stuck.
Looking forward to hearing your suggestions! Thank you so much!