How to assign a seq number to each table record

Home Forum Working with Tables How to assign a seq number to each table record

Tagged: 

This topic contains 3 replies, has 0 voices, and was last updated by  Winson 7 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #852

    Winson
    Participant

    Hi, may i know how to assign a unique seq number to each record’s 1st column in table?

    Thanks

    #5894

    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.

    Workflow software, Process software, Procedure software

    #5900

    Winson
    Participant

    Thanks Dennis for your reply. But if I want to assign seq # to column 1 in table in the same form (e.g. 1 for first row, 2 for 2nd, etc), how to do?

    #5902

    Create a behavior to loop through the table.

    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.

    Workflow software, Process software, Procedure software

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.