Hello.
I was trying to create an automation which would trigger new photos in google drive folder. When it triggers new files, it automatically uploads it to chatgpt to analyze it and create output in json format. I have specified to output 2 arrays where 1. is Title and 2. is Description. When I try to use these two outputs in Shopify Create Product page, it doesnt read Title array. Maybe Im using wrong tool or what? Here are pictures of my current flow.
This is the output from chatgpt:
[
{
"result": "[\n {\n \"Title\": \"Mystic Night Drops\"\n },\n {\n \"Description\": \"### **Material:**\\n- Plastic\\n- Test words\\n\\n### **Size:**\\n- Diameter: Close to 2 x 3.5cm\\n- Thickness: 2-3mm (may vary)\\n\\n### **Weight:**\\n- About 5 grams\\n\\n### **Color:**\\n- Black and Purple with Pink accents\\n\\n### **Design/Style:**\\n- Abstract, Modern, Mystical, Handmade\\n\\n### **Say:**\\nITest text\"\n }\n]",
"id": "chatcmpl-A6jzpFSVgjo4WeMdhyyvi",
"object": "chat.completion",
"created": "2024-09-12T19:42:21.000Z",
"model": "gpt-4o-2024-05-13",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "[\n {\n \"Title\": \"Mystic Night Drops\"\n },\n {\n \"Description\": \"### **Material:**\\n- Polythenol\\n- Chubby\\n\\n### **Size:**\\n- Diameter: Close to 2 x 3.5cm\\n- Thickness: 2-3mm (may vary)\\n\\n### **Weight:**\\n- About 5 grams\\n\\n### **Color:**\\n- Black and Purple with Pink accents\\n\\n### **Design/Style:**\\n- Abstract, Modern, Mystical, Handmade\\n\\n### **Saywhat:**\\nAnd it goes like this.\"\n }\n]",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 1395,
"completion_tokens": 236,
"total_tokens": 1631
},
"system_fingerprint": "fp_992d1ea92d"
}
]
This is what I get from JSON:
After JSON I grab info from JSON Description Array and create a HTML for Shopify Body HTML.
Input bundle for SHopify goes like this:
[
{
"title": "Mystic Night Drops",
"status": "draft",
"vendor": "Go Store",
"body_html": "",
"product_type": "Drop Pants"
}
]
And output budle goes like this:
[
{
"tags": [],
"images": [],
"id": 9693855252746,
"title": "Mystic Night Drops",
"body_html": "",
"vendor": "Go Store",
"product_type": "Drop Pants",
"created_at": "2024-09-12T19:42:52.000Z",
"handle": "mystic-night-drops-1",
"updated_at": "2024-09-12T19:42:52.000Z",
"published_at": null,
"template_suffix": null,
"published_scope": "web",
"status": "draft",
"admin_graphql_api_id": "gid://shopify/Product/9693855252746",
"options": [
{
"id": 12148892795146,
"product_id": 9693855252746,
"name": "Title",
"position": 1,
"values": [
"Default Title"
]
}
],
"variants": [
{
"barcode": null,
"compare_at_price": null,
"created_at": "2024-09-12T19:42:52.000Z",
"fulfillment_service": "manual",
"grams": 0,
"id": 49937184358666,
"image_id": null,
"inventory_item_id": 51928220041482,
"inventory_management": null,
"inventory_policy": "deny",
"inventory_quantity": 0,
"old_inventory_quantity": 0,
"option1": "Default Title",
"option2": null,
"option3": null,
"position": 1,
"price": "0.00",
"product_id": 9693855252746,
"requires_shipping": true,
"sku": "",
"taxable": true,
"title": "Default Title",
"updated_at": "2024-09-12T19:42:52.000Z",
"weight": 0,
"weight_unit": "g"
}
]
}
]
What am I doing wrong here? All I want is to seperate Title from Description and automatically map them to Shopify create product.