How to create auto increment field on form load in InfoPath in SharePoint 2013/Online

In this InfoPath tutorial, we will discuss how to show an auto increment field in InfoPath 2013 form in SharePoint 2013.

1. Open Infopath 2013 form using InfoPath designer 2013 and a text box control to the form.

2. Go to the textbox properties and add a default value(EX.1).

3. Publish InfoPath form to the SharePoint 2013/Online site.

4. Go to the Infopath form and create a “Receive” data connection(Ex.Receieve Data) by following the SharePoint site and library name.

5. Select the ID field and the autoincrement field name while creating the data connection.

6. Now click on the Data tab->form load.

7. Add action and set the condition as if ID(form Receive Data)not equal to zero.

8. Then set rule as a query for data connection(Recieve Data)
Set field value of textbox=max(autoincrement field(from Receive Data connection))+1

See the attached screenshot for more information.

auto increment field infopath 2013
auto increment field InfoPath 2013

9. Publish the form and see the result, you will see InfoPath increment number field.

You may like following InfoPath 2013 SharePoint tutorials:

I hope this InfoPath tutorial will help to learn how to create auto increment field on form load in InfoPath in SharePoint 2013/Online.