Counter

Purpose of this building block

The counter generates a natural number that is incremented each time the building block it executed. You may define the starting number, the increment as well as the period after which the counter is reset.

0 variables
1 variables
${invoiceNumber}

Possible 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 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.

Useful combinations

Generating formatted invoice numbers

invoiceNumber
formattedInvNr
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.

Getting started

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

Questions and Feedback

If you have any comments on this guide, feel free to add them 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:

Share on Google+Share on FacebookShare on TwitterShare on LinkedIn