How to Create a Separate Auto-Increment ID for Each Power Apps Choice
Question details
The user needs to generate sequential numbers that restart and increment independently for each specific choice (e.g., color) selected in a SharePoint list via Power Apps.

- Product
- Power Apps
- Device & OS
- not provided
- Scenario
- Customizing a SharePoint list with Power Apps where each category in a Choice column requires its own separate sequential ID system.
- Observed behavior
- Sequential numbering needs to be dynamically calculated based on the selected choice value during item creation, rather than using a single global ID for the entire list.
Ensure you have Edit permissions for the target SharePoint list and adequate permissions to create Power Automate flows or modify the Power Apps canvas application.
Generate Auto-Increment IDs using Power Automate
Use a Power Automate flow to reliably query the latest ID for a specific choice and increment it when a new item is created.
This method is highly recommended as it handles the logic on the server side, which prevents duplicate IDs if multiple users submit forms at the exact same time.
Go to Power Automate, create a new flow, and select the 'When an item is created' SharePoint trigger. Point it to your specific site and list.
Add a 'Get items' action. Use an OData Filter Query to filter the list by the specific choice value of the newly created item (e.g., Color eq 'Red'). Order the query by your custom ID column in descending order (desc) and set the 'Top Count' to 1.
Initialize a variable. Use an expression to check if the 'Get items' output is empty. If empty, set the value to 1. If not, add 1 to the highest ID retrieved.
Use a 'Format number' action or the padLeft() expression if you need leading zeros (e.g., 001). Finally, use the 'Update item' SharePoint action to save this generated ID back to the item that triggered the flow.

Handle Numbering Logic Directly in Power Apps Formulas
Generate the category-specific ID immediately when the user submits the form using Power Apps functions.
Analyze Exported SharePoint Data with WPS Office
While Power Apps handles your custom data entry and logic, analyzing the exported SharePoint lists is often necessary. WPS Office serves as a powerful, free, and lightweight alternative to Microsoft Office for organizing, charting, and presenting your exported list data with full format compatibility.
- 1. Export your list data: In your SharePoint list, click on 'Export' and choose 'Export to Excel' or 'Export to CSV'.
- 2. Open with WPS Spreadsheet: Launch WPS Office and open the downloaded file to view your items and custom auto-incremented IDs.
- 3. Analyze and chart your data: Use built-in pivot tables and charts in WPS Spreadsheet to analyze the distribution of your Power Apps choices.

Frequently Asked Questions
Can I format the auto-increment ID with leading zeros in Power Apps?
Yes, you can use the Text function in Power Apps to pad numbers with leading zeros. For example, using Text(NextID, "0000") will turn the number 5 into "0005".
What happens if multiple users submit a Power Apps form at the exact same time?
If you are calculating the ID using Power Apps formulas, concurrent submissions might fetch the same maximum number and generate duplicate IDs. Using a Power Automate flow with concurrency control settings is a safer approach for high-traffic applications.
Does the Power Apps formula method cause delegation warnings?
It can. You must ensure your Filter function relies on delegable columns (like standard Choice columns) to avoid the 2,000 item limit warning in Power Apps when it searches for the maximum ID in large SharePoint lists.




