Hi Everyone, I’m new user with Make and I can’t seem to get around an issue I’m having with properly mapping fields to export to google sheets from a GPT vision completion.
Im pulling invoice data from a pdf using GPT vision which results in a Long String.
I’m then using json outputting to pull all the high level headers, but then i’m stuck when it comes to Line items. i can’t get pass the first line item, as the mapping keeps duplicating the value of the first group of variables…
Line items seem to be mapped as an array (see bundle below)
[
{
“result”: “{\n "Invoice": {\n "Invoice_Number": "RE30232",\n "Invoice_Date": "13.06.2024",\n "Delivery_Date": "n/a",\n "Supplier_Email": "info@andraschkokaffee.com",\n "Contact_person": "Steph",\n "Contact_person_email": "n/a",\n "Supplier_Name": "Andraschko Kaffeemanufaktur GmbH & Co. KG",\n "Supplier_VAT_ID": "DE248395736",\n "Total_Net_Amount_subject_to_7_percent": "685,74 €",\n "Total_Net_Amount_subject_to_19_percent": "n/a",\n "Section_Net_Amount_subject_to_7_percent": "n/a",\n "Section_Net_Amount_subject_to_19_percent": "n/a",\n "Total_NET_AMOUNT_to_pay": "685,74 €",\n "Total_7_percent_AMOUNT_to_pay": "48,00 €",\n "Total_19_percent_AMOUNT_to_pay": "n/a",\n "Total_combined_VAT_AMOUNT_to_pay": "48,00 €",\n "Total_GROSS_AMOUNT_to_pay": "733,74 €",\n "Payment_Due_Date": "14 days from invoice date",\n "leergut_pfand_amount": "n/a",\n "total_net_weight": "n/a",\n "total_gross_weight": "n/a",\n "Line_Items": [\n {\n "Colli": "n/a",\n "Line_item_description": "Karton Wiener Kaffeehausmischung Espresso Blend 1000g x 12",\n "Inhalt": "n/a",\n "Menge": "3,00 Stk.",\n "Einzelpreis": "225,36 €",\n "Einzelpreis_with_Einheit": "225,36 €/Stk.",\n "Gesamtpreis": "676,08 €",\n "VAT": "7%",\n "Context": "Karton Wiener Kaffeehausmischung Espresso Blend 1000g x 12 at 225,36 €/Stk., ordered 3 Stk. Total was 225,36 €/Stk. x 3 = 676,08 €"\n },\n {\n "Colli": "n/a",\n "Line_item_description": "Night Express Espresso Blend entkoffeiniert 250g",\n "Inhalt": "n/a",\n "Menge": "2,00 Stk.",\n "Einzelpreis": "4,83 €",\n "Einzelpreis_with_Einheit": "4,83 €/Stk.",\n "Gesamtpreis": "9,66 €",\n "VAT": "7%",\n "Context": "Night Express Espresso Blend entkoffeiniert 250g at 4,83 €/Stk., ordered 2 Stk. Total was 4,83 €/Stk. x 2 = 9,66 €"\n }\n ]\n }\n}”,
“id”: “chatcmpl-9lcGtaxeTdToV7PQ7dkweT6iKrvuJ”,
“object”: “chat.completion”,
“created”: “2024-07-16T13:12:39.000Z”,
“model”: “gpt-4-0613”,
“choices”: [
{
“index”: 0,
“message”: {
“role”: “assistant”,
“content”: “{\n "Invoice": {\n "Invoice_Number": "RE30232",\n "Invoice_Date": "13.06.2024",\n "Delivery_Date": "n/a",\n "Supplier_Email": "info@andraschkokaffee.com",\n "Contact_person": "Stephanie Aman-Mendrzky",\n "Contact_person_email": "n/a",\n "Supplier_Name": "Andraschko Kaffeemanufaktur GmbH & Co. KG",\n "Supplier_VAT_ID": "DE248395736",\n "Total_Net_Amount_subject_to_7_percent": "685,74 €",\n "Total_Net_Amount_subject_to_19_percent": "n/a",\n "Section_Net_Amount_subject_to_7_percent": "n/a",\n "Section_Net_Amount_subject_to_19_percent": "n/a",\n "Total_NET_AMOUNT_to_pay": "685,74 €",\n "Total_7_percent_AMOUNT_to_pay": "48,00 €",\n "Total_19_percent_AMOUNT_to_pay": "n/a",\n "Total_combined_VAT_AMOUNT_to_pay": "48,00 €",\n "Total_GROSS_AMOUNT_to_pay": "733,74 €",\n "Payment_Due_Date": "14 days from invoice date",\n "leergut_pfand_amount": "n/a",\n "total_net_weight": "n/a",\n "total_gross_weight": "n/a",\n "Line_Items": [\n {\n "Colli": "n/a",\n "Line_item_description": "Karton Wiener Kaffeehausmischung Espresso Blend 1000g x 12",\n "Inhalt": "n/a",\n "Menge": "3,00 Stk.",\n "Einzelpreis": "225,36 €",\n "Einzelpreis_with_Einheit": "225,36 €/Stk.",\n "Gesamtpreis": "676,08 €",\n "VAT": "7%",\n "Context": "Karton Wiener Kaffeehausmischung Espresso Blend 1000g x 12 at 225,36 €/Stk., ordered 3 Stk. Total was 225,36 €/Stk. x 3 = 676,08 €"\n },\n {\n "Colli": "n/a",\n "Line_item_description": "Night Express Espresso Blend entkoffeiniert 250g",\n "Inhalt": "n/a",\n "Menge": "2,00 Stk.",\n "Einzelpreis": "4,83 €",\n "Einzelpreis_with_Einheit": "4,83 €/Stk.",\n "Gesamtpreis": "9,66 €",\n "VAT": "7%",\n "Context": "Night Express Espresso Blend entkoffeiniert 250g at 4,83 €/Stk., ordered 2 Stk. Total was 4,83 €/Stk. x 2 = 9,66 €"\n }\n ]\n }\n}”
},
“logprobs”: null,
“finish_reason”: “stop”
}
],
“usage”: {
“prompt_tokens”: 1279,
“completion_tokens”: 669,
“total_tokens”: 1948
},
“system_fingerprint”: null
}
]
The thing with Line item is, because i cant predict w/ exact certainty how many will be in the next invoice, they have to be dynamic and I’m really stuck…
This the current scenario…
Please help!