I am trying to create a scenario in Make.com that takes a record from Airtable and creates an invoice in Freeagent.com.
The issue is that the invoice has multiple line items, which are pulled through from airtable, but I don’t know how to iterate through the line items and create a structure that the invoice items field on the freeagent module is expecting.
I believe I need to iterate, and then create the json structure, but I don’t really have the experience to do that!
Here is my airtable output bundle and freeagent input bundle:
[
{
“FreeAgent Ref”: “3938630 copy copy”,
“Ready to Invoice”: true,
“ CAMPAIGN”: [
“receXYbDrSEV6PnyE”
],
“ INVOICED ITEMS”: [
“recmkh4eEjOxeYmsc”,
“recDWZvqFOYeJAtiM”,
“recjkEKZZf5dPy2og”,
“rec1btktbM1BCi1Gz”,
“recq32SMQTaLqyzaH”,
“recFWM0FsBiT3rWk8”
],
“CLIENT”: [
“recGywQ7orhBmGQIi”
],
“CLIENT ID”: [
“12121872”
],
“PROJECT ID”: [
“3938630”
],
“PO NUMBER”: [
“recK5nfoIKika5OiB”,
“recK5nfoIKika5OiB”,
“recK5nfoIKika5OiB”,
“recK5nfoIKika5OiB”,
“recK5nfoIKika5OiB”,
“recK5nfoIKika5OiB”
],
“Created Date”: “2024-09-28T07:29:18.000Z”,
“AMOUNT”: [
“2926”,
“3155”,
“11200”,
“3500”,
“8887”,
“13796.2”
],
“ITEM DESCRIPTION”: [
“A”,
“B”,
“C”,
“D”,
“E”,
“F”
],
“PO Fx”: [
"POXXX "
],
“id”: “recRbBeP0SO9rqb26”,
“createdTime”: “2024-09-28T07:29:18.000Z”
}
]
And here’s the freeagent input bundle…
[
{
“contact”: “12121872”,
“project”: “3938630”,
“currency”: “GBP”,
“dated_on”: “2024-09-28T07:32:18.000Z”,
“po_reference”: "XXX ",
“invoice_items”: [
{
“price”: 2926,
“quantity”: 1,
“item_type”: “Products”,
“description”: “A”
}
],
“show_project_name”: true,
“payment_terms_in_days”: 15,
“send_new_invoice_emails”: false
}
]