How to Number Rows in SharePoint
An autonumber feature for rows in SharePoint lists is not a standard within the SharePoint environment. You can always view the SharePoint list in "Datasheet View" to get a quick glance at line numbers, or export the SharePoint list to an Excel workbook and use Excel's automatically numbered rows to number the items. However, there is a way to write a simple workflow using SharePoint Designer to automatically number each new row in a SharePoint list.
Instructions
-
-
1
Open SharePoint Designer and click on the site that contains the SharePoint list to edit. The site opens in Designer.
-
2
Click the "Lists" entry, then click the list to edit in the left pane of Designer. The list opens for editing in the right pane.
-
-
3
Click the "File" option on the top navigation bar, then click "New." Click the "Workflow" option. The Workflow dialog box opens.
-
4
Type a name for the new workflow, such as "Autoassign Numbers," into the Workflow Name input box.
-
5
Click the drop-down list, then click on the list where the workflow will connect and process.
-
6
Enable the check box next to "Start This Workflow Automatically When a New Item is Created."
-
7
Click the "Variables" button at the bottom of the dialog box. The Variables Definition dialog box opens. Click the "Add" button.
-
8
Type "aNumber" or another intuitive name for the new autonumber variable. Click the "Number" option as the variable type.
-
9
Click "OK" twice, then click "Next." The Workflow Steps dialog box opens.
-
10
Click the "Actions" button in the Step 1 section. Leave the name of the step as "Step 1," and leave the Conditions input box empty. The Actions dialog box opens.
-
11
Click "Set Workflow Variable." An Action is added to Step 1. Click the link labeled "Workflow Variable." A drop-down box opens. Click "Variable: aNumber" -- or the name you gave the new autonumber field -- and click the "Value" link. The Value Definition dialog box opens.
-
12
Click the "Data Source" drop-down box, then click "Unique Numbers." Click "NextNumber" in the drop-down box under the label "Field." The dialog box expands and includes a new section named "Find List Object."
-
13
Click the "Field" drop-down, then click "Unique Numbers:Title." Type a name for the value, such as "CUSTOMERNO." Click "OK." Click "Yes" on the warning dialog box stating that SharePoint may return more than one item.
-
14
Click the "Actions" button once again, then click "Set Field in Current Object." Click the "Field" link and click on the field in your list where the new value will appear. In the above example, this field is "CUSTOMERNO."
-
15
Click the "Value" link, then click "Workflow Data" from the Data Source drop-down list. Click the "aNumber" option in the Variable list, then click "OK."
-
16
Click the "Actions" button once more, then click "Update List Item" from the Data Source drop-down list. Click "Update List Items in This List." A new dialog box opens.
Click the "List" drop-down box, then click "Unique Numbers." Click the "Add" button and click the first drop-down box. Click "LastNumber," then click the "Formula" button. The Formula dialog box opens.
-
17
Click the "Data Source" drop-down box, then click "Workflow Data." Click the "Field" hyperlink, then click "Variable: aNumber." Click "OK" twice. The Find List Object box opens. Click the "Unique Numbers:Title" option and type "CUSTOMERNO" into the Value field. Another SharePoint warning appears. Click "Yes" on the warning, then click "Finish." The workflow is created to autonumber items in the specified SharePoint list.
-
1
Tips & Warnings
You can apply the new workflow to other lists by changing the selected list in the workflow definition.