Airtable and Google Sheets integration - Build an invoice with multiple line items (how to parse range)

Hi,

New-ish Make user here, still trying to get to grips with how this all works - so apologies in advance for the rookie question!

I’m trying to create an invoice template based on data within Airtable. In Airtable I have one table (invoices) and another (line items). Each invoice can have multiple line items. I have managed to get a make integration working which pulls the headline data from the invoice table into a new google sheet (based on a pre-existing template), and then creates a second sheet within the same google doc that has the corresponding line items. I’ve built it as follows (very happy to have feedback if this isn’t the best way of doing it - it’s been a bit of trial and error along the way!)…

My question is whether it’s possible to change the final step (which is currently bulk-creating new rows on the second sheet with the details for each line item) and instead have the line items added to the main invoice within a pre-existing line items table. The invoice looks like this:

And the second sheet with the batch added line items currently looks like this:

This is a partial solution and at the moment I am just copying and pasting the line items from the second sheet into the main body of the invoice, but I am sure that there is a way to get this to all work automatically - I just don’t know what it is! I have tried changing the order of the modules so that I get the array of line items before creating the Google Sheet invoice (in the hope of putting the array into the line items table on the main invoice front sheet), but that just creates multiple invoices (one for each line item) rather than one invoice with all the line items listed.

Sorry if I haven’t explained this clearly - happy to share more info or screenshots based on what it is helpful to see.

Thanks in advance for any help!

Hey Kate,

firstly → you always aggregate the module that produces the extra bundles. In your case that is the iterator, not the Airtable module. Your aggregator isn’t doing anything right now.

Second → are the rows on the invoice static? In this case, you can use the Update a Row module and edit them directly.

Thanks so much for your response :slight_smile:

I’ve adjusted the order of the modules and it’s now looking like this:

It’s now dropped the first of the items into the line items table, but not all of them:

No, the lines aren’t static - there will be different number of lines for each invoice, containing different data each time. I had been hoping to use bulk update to bring them all in at once but can’t find a way to force each item onto a new row.

Ok so you can use Search Rows first to find the first row of the Line Item table and then use Update a Row to edit the ones you need.

Thanks :slight_smile: I’ve added that and it’s working for the first line (hurrah!) meaning that I am able to get the line item details into the right place in the table. However, it only ever populates the first line, which I think is because as it iterates over each of the associated line items it overwrites the data in the row, rather than moving down and updating the row underneath. I’ve tried both the ‘update row’ and the ‘bulk update row’ and it’s happening with both of them.

Based on the addition of the Search Row module my overall setup now looks like this:

For the final ‘Bulk Update Rows’ module this is the config (using the row ref from the ‘Search Row’ module):

and this is the output:

You can see it’s successfully processed all 3 line items, but for each one it has updated the range A28:D28 rather than updating the rows below.

Is there a way for me to set the row reference in the Bulk Update Rows module so that it dynamically increases by one each iteration?

Thanks again for your help - appreciate that these are probably very simple questions for experienced Make users! Ha :sweat_smile:

Use the row number coming from the search module as a starting point and increment it using the bundle order position.

Something like Row Number - 1 + Bundle order position should do the trick.