Hello guys.
This is my first post in the Community and is for share something.
I was looking for a simple way to get an incremental number for invoicing and all the solutions that I found mentions several nodes, code, functions, etc…
But I realize that you can create, use and update own tables.
So I test this and work like a charm.
I tried to upload the json file of the test workflow but I can’t because I’m new, so I’ll try to explain with words the workflow.
The idea it’s simple:
Create a table (let’s say “invoice numbers”) with one column and one row. So you put in that A1 (just for visualize) the start number in number format. Let’s say 0
Then you get that number using the Datatable node and send it to a Set node. There you add 1 (or the qty you want/need) to the number that you get from Datatable node (the 0 mentioned earlier) like this: {{ $json.invoice_number +1 }} and update the same cell in the table with the new number using the Datatable update row to the same table where you get the original 0 .
And that’s it!!
Trigger → Node: Datatable Get Row invoice_number → Node: Set. Fields to Set: invoice_number (type number) = {{ $json.invoice_number +1 }}→ Node: Datatable Update Row invoice_number.
With this in your workflow you will get a new number everytime.
I hope that this helps someone and you can understand the way I explained it.
Thanks!