In the screen shot below, I have an invoice generator which pushes invoices out of Coda via a pack to Xero. I have another table in a separate page which contains all invoices created in the Xero app along with their Invoice number and Invoice ID. In the invoice generator table, I’m adding a button which sends invoices to the contact, this button requires the invoice ID. The Invoice ID is auto-generated by Xero and then pulled into the invoice table in Coda. The Invoices field from the screenshot is a lookup to the invoice table which grabs the invoice number (I’m hoping this will help with also grabbing the invoice ID which is on the same table).
Once the new invoice is created, I’m looking to get the invoice ID details from the invoice table so I can pass it to the send invoice button. Any suggestion on how this can be done without creating a separate view of the invoice table?
Hi @Amir_Banihashemi , thanks for reaching out!
Would you mind sharing your doc with us so we can help you out with your automation?
You can do that by going to the Share in the top right-hand corner, clicking the button in the top right (to the left of the “X”), and toggling on Share with Coda Support (the gif below shows how to do this).
Afterward, please reply here with the link (copy/paste this from the address bar) to your doc so we can take a look for you.
Hey Amir! Have you thought about pulling in the Invoice ID into a column in this table, and then having the button reference the Invoice ID column per row? That would look like this:
Then in your Send Invoice button, you could point the Invoice ID parameter to the Invoice ID column like this:
Which would then pull the specific Invoice ID for that row. Does that help accomplish what you’re aiming for? Let us know! If not, we can explore some other options
Thank you for looking into this!
Your suggestion would work if the “new invoice” was already synced to the Invoices table and the said table was synced via the Xero pack.
Here’s a quick video which may help explain my challenge better.
Ahh, I see what you mean! Thanks for the video, definitely helpful!
I do have one clarifying question:
- in your Invoice & Bill Buttons table, will the most recently created invoice always be the correct invoice to pull into the Invoices column? Based on your video I would assume yes, but want to be sure.
If that’s the case, this is how I might go about it. To be honest I’m not sure if this will work for sure, but it’s a potential solution:
Find Invoice # button: create a “helper” button in Invoice & Bill Buttons table that pulls in the most recent invoice number to the Invoice # column. This would be a modify row button, and the formula for the column modification would look something like
Invoices and Bills.Invoice Number.Last() - this pulls in the number for the last created (most recent) invoice
Refresh Pack Table button: create a button that refreshes your Invoices and Bills Xero sync table on push. This can live on the canvas.
create a button that pushes buttons: to push the New Invoice button in your Invoice & Bill Buttons table, Refresh Pack Table Button, and Find Invoice # button on your Invoice & Bill Buttons table. This can live on the canvas. You can also create an automation to push these buttons, if you’d like once you have your desired flow set up.
Then, create an automation that runs based on row change - I would aim this at the Invoice # column in your Invoice & Bill Buttons table. Then have this automation modify the row to pull in the latest invoice from the Xero sync table. In Set Values, select the Invoices column and set the value to
Invoices and Bills.Last()
This automation should then populate your Invoices Column with the correct invoice, along with the Invoice ID.
Hopefully this helps you get closer to a solution! Give it a shot and let us know how it goes