Each instance has a unique sequential number – the instance number. After the form is published the first time, the first instance starts at instance #1. You can simply use the instance #, or use a formula to build on it.
Remember that an instance # is not created until the instance has been submitted the first time. You may need to create a behavior on when form opens that sets a field (call it hidden instance # helper)with Special – Instance Number. Then use a simple branch to look at at that field. If the field value is less than 1 – submit and re-open the same instance. If it is = or greater than 1 go to an Exit behavior object.
Start with a Set Table Rows Object – Move to first row. Next use two Set Fields. Set a hidden helper field to 1. Set Field # column-current row to value in hidden helper. Set Table Rows Object – Move to next row. Simple Branch object – Was last command successful? If true use two Set Fields. Set the hidden helper field using a formula (hidden helper value + 1). Set Field # column current row to value in hidden helper. Then loop back to second Set Table Rows object (move to next row). If false go to Exit behavior object because you have reached the end of the table.