Counter

Create invoice numbers and more

Load counter mycounter, increase by 1 and reset never

invoiceNumber

The counter generates a natural number that is incremented each time the building block is getting executed.

You can set the starting number, the increment as well as the period after which the counter is reset to zero.

Use cases

  • Create a unique counter for invoice numbers
  • Count how many times a form has been submitted

Configuration

Click on the bold parts in the description to adjust the counter to your needs. You can change the name, key, reset frequency and increment value.

The name of the counter will be the variable name that you later use in your templates.

You may want to use invoiceNumber for the counter of your invoice numbers.

You also have to specify the internal key for the counter. A random key is generated by default. If you want to use the same counter across multiple documents you can choose a unique name manually.

 Counter value

Click on the counter value button on the right of the building block toolbar to change the current value of this counter.

It may take a few moments until the dialog shows up as Ultradox will have to grab the current value from the server.

Unique counters

Counters in Ultradox are great for creating invoice numbers.

If you trigger Ultradox from an external service like stripe to generate an invoice whenever a user makes a payment, you can assure to create a counter only once for a given transaction id.

Let's say you are receiving a payment from a customer and stripe is sending you a variable called transactionId containing the unique transaction id abcd1234. When running your flow the counter will be increased to generate a new invoice number.

If your customer has lost the invoice and you want to run it once again or you want to refund your payment, stripe will send your the same transaction id.

If you enter  as unique identifier Ultradox will check if a counter has been created for the given id before.

Instead of increasing the counter it will then load the old generated value so that you can create another invoice with the old invoice number.

Useful combinations

Generating formatted invoice numbers

Increase by 1 and reset yearly

invoiceNumber

Load form to format number

invoiceNumber
formattedInvNr

Generate invoice from template

formattedInvNr
PDF document

Add a Form building block right after the counter to format the invoice number according to your needs.

Add a field of type String to your form and give it a reasonable name, e.g. formattedInvNr .

Enter the desired format for your invoice numbers into the form field, e.g. ${now;date(op=yyyyMMdd)}-${invoiceNumber;number(op=0000)}  and save the form.

When generating a PDF document from a Google Docs template you can then access the formatted invoice number right from the Ultradox Template Editor sidebar.

Learn more

Invoicing For Stripe

Send beautiful PDF invoices to your customers

Do you want a super simple way to send fully customizable PDF invoices to your customers?

Do you want to display the included VAT on your invoice?

Do you sell to different countries and want to send out receipts and invoices in your customer's language with proper currency formatting?

Do you want to send out corrected invoices to your customers when refunding money from your stripe dashboard?

Copy the Invoicing for stripe app to see this building block in action

Copy App

Questions and Feedback

If you have any comments on this page, feel free to add suggestions right to the Google document that we are using to create this site.

If you are not yet member of the Ultradox community on Google+, please join now to get updates from our end or to provide feedback, bug reports or discuss with other users.

Last Updated: 15.05.18