▶️ Showcase 7 - Send invoices as PDFs via email using dynamic tables

Description

How to use workflow automation with dynamic tables to create an invoice and send it via email.
With Tape’s built-in workflow automation, you can create and manage dynamic tables with your own variables, thus automating the entire invoicing process from creating the invoice to sending it via email to your customers.

Automation

When the 25th of the month arrived → then generate invoices with the PDF editor, add dynamic tables and email them to businesses.

Showcases for a head start

We highly recommend duplicating Tape showcases to get the most out of workflow automation. Once you have duplicated the showcases to your personal Tape organization, you can customize the showcases as you like without wasting time rebuilding them.

Duplicate showcase

  • Click here :point_right: workflow automation showcases
  • Click the Duplicate button at the top right
  • Only Tape users will be able to duplicate the showcase
    • Tape users who click duplicate and are logged into a Tape account will be able to duplicate the showcase in their personal organization
    • Anyone signing up for a Tape account via “Duplicate” will see an easier, shortened version of the sign-up process, so they can start even faster

Run the automation:

  • Click the workspace Finance in your left sidebar
  • Tap the app Companies
  • Click to open the record with the title “Acme Inc.”
  • Change the email from ENTER.YOUR.EMAIL@YOUR.DOMAIN.com to your test email-address
  • Go to the app Companies
  • Click on the ... menu next to the app name
  • Tap on Workflow automation
  • Select Generate invoices with the PDF editor, add dynamic tables, then email them to businesses.
  • Start a manual run on the selected record “Acme Inc.”

Check out more showcases →

2 Likes

On what day should we talk?

Unique IDs are great for navigation between records, etc…
But not for invoicing I think since can be easily deleted and is gone forever.
So what would be best practice for auto incrementing invoice number?
Before we use - get view and increment it +1.
I have tried it using text field and number field with no luck.
collected_invoice_field_number_formatted += 1,

let counter = 0;

function getNextId() {
  counter++;
  return counter;
}

const nextId1 = getNextId(); 

console.log(nextId1); 

Any other better options than unique ID?

2 Likes

@tomaz thanks for sharing your thoughts!

While I would agree that a potential drawback of the unique ID field is the fact that “deleted” records will leave an ID forever consumed and gone, that could also be beneficial. Think of invoice IDs where you would never reuse an ID at all to prevent clashes (removing a record could have been an accident).

Furthermore, the unique ID ensures uniqueness (preventing duplicates) and monotony (only increasing numbers). If you implement your own ID, you will need to enforce uniqueness yourself.

If you still want do implement your own ID, your approach would work with a couple of tweaks:

  • Create a number field in your app
  • Create a first record and fill your initial ID, e.g. 1 or 1000.
  • Add an automation that triggers on create and fills your ID field by collecting inside that app via the “Search records” action. You can limit your results to 1, as you only need the most recent one. When you search, the default sort should always be the creation date descending - so your newest one would be your largest ID
  • You can then use that value using a calculation assignment and to something like this: collected_invoice_field_number_decimal += 1

This should give you the desired result. Watch out for duplicates though, as Tape cannot assist preventing them natively now. :information_source:

Let me know if you need more info on this, you can also create a dedicated question in the “Ask the community” section.

Happy building & let me know how it goes :rocket:
Tim

1 Like

Crap. This may be an oversight on my end regarding the unique ID field.

What is the best practice for this instance

01 invoice one
02 invoice two
03 …three
04 …four
05 …five

Invoice three is deleted for whatever reason

01 invoice one
02 invoice two
03 …four
05 …five

If I’m understanding this correctly, then all previously created items will be inaccurate if previous record is removed.

I thought about copying the ID to a text/number field to hold it but the next record create would also have that same ID so that’s not a great resolve.


Use case for us: we create estimates in tape, receive approval, copy over to accounting program. Receive payment and then update record in Tape. The ID is the unique ID used to keep records in sync. We also use IDs linked to QR codes that allow clients to reorder product by scanning. In the above instance, all record updates would now be linked incorrectly if an item was intentionally or accidentally removed for any reason.

Is there any possibility of having a toggle to keep the count and increase regardless if an item was deleted? If that is out of scope, is there a suggested workaround?

I did not see your answer before posting @Tim. I’ll explore this workaround after you confirm that having a toggle to accomplish this natively is/not a feasible addition to the ID field.

I always appreciate your detailed responses to everyone.

1 Like

Hi @1F2Ns, did you try maybe Tims thoughts on this one.
I’m struggling with This part:

“Search records” action. You can limit your results to 1, as you only need the most recent one. When you search, the default sort should always be the creation date descending - so your newest one would be your largest ID"

Anything I tried with collected_invoice_field_number_decimal += 1 i always just adding number 2.
I know that in previous platform we use counter app to increase number and then referenced it, so I would be great if we can find solution.
By the way, love the stuff you post. Have learned a lot from reading your post.

1 Like

I misunderstood the question/issue here so I wanted to come back to make things clear on the way Tape Unique IDs currently work.

Unique Ids are +1 for ever item created regardless if one is deleted.

Here are screenshots from my testing

  1. App with a title and Unique ID
  2. created four items
  3. deleted ‘item three’
    • note how ‘Item four’ is still ‘ID 4’
  4. deleted ‘Item four’ to see if creating a new one would receive ‘ID 4’ since it was the newest
    • note that ‘Item five’ received ‘ID 5’

IDs are working as expected and a perfect solution for creating any of the following:

  • Estimate numbers
  • Invoice Numbers
  • Support Ticket IDs

I apologize for any confusion my previous comments may have made.

2 Likes

Thanks for the detailed clarification - glad to hear this suits your needs. @tomaz does this also resolve your question?

Thank @1F2Ns for detailed presentation.
However @Tim this not solve my problem. Now I know that unique IDs logic is the same as it was in previous system (I don’t want to even mention the name :yawning_face:). Just to be clear, every saved record gets its own ID. If deleted that ID is gone forever and next saved will have next number in order.
But our use case would not be great for this type of counting.
Our ideal process would be:
Get view, get only the last number, add +1 to that number when new record is saved.
Screenshot 2023-10-13 at 09.48.37
As seen on image.
When we create new record it should be 2023-0702. If somehow we don’t need that record anymore and delete it. Again next saved recdord shoud be 2023-0702. And so on… Hope this makes sense.

If I understand correctly, you are creating a table of all of your invoices. And you were building this by adding +1 to each new row. Correct? I assume all of these will be linked to the individual invoice. Correct?

Maybe there is a way to build this out differently where you can skip any deleted records if your ask is not possible. I’m just speaking out loud. It’s early. I may not even be talking coherently on the internet yet so disregard this message if I don’t make sense :coffee::grin:

3 Likes

@1F2Ns your morning coffee made your assumptions right.
I will play around with numbers and will let community know if I find a good solution, maybe in the future someone will come across the same problem.

Hi @tomaz
I am not really sure if this helps you or not but if you do a search for records then a roll-up count that gives you the number of records and therefore a number:

This means that if you delete a record and create a new one it will reuse the number of the deleted item:

I am not sure how well this will work with hundreds of records in the app and I may still be missing what you are trying to do but this seemed like a possible workaround for you.

2 Likes

@Jason this is exactly what we need.
Just tried and it worked fine.
Just small tweaks on our side:
Saved view with date current year. And rollup this year number.
Every year before first one is created we have to change saved view and change it in get view action.
Much appreciated and thanks for your help.

2 Likes

@tomaz really pleased that it helps you and the fact that you have to do the rollup on a view alleviates one of my concerns with the method. I have to say that I personally would be very hesitant to create Invoice numbers using this method but if it works in your use case then great and that’s all that matters :slight_smile:

@Jason this is currently not being used for invoicing. I was just looking for continuous numbers in case someone decides to delete record where using ID deleted number is then lost forever.
This numbers that you see are cars being bought and later sold. So every car gets its own number and they can be deleted if all demands are not fulfilled.
For invoicing here it needs to start from number 1 in the beginning of the year. And record can also be deleted before sent out, so again unique ID are not an option.
Thanks though for your advice and your feedback. Much appreciated. :vulcan_salute:

1 Like