I am using a phone version of a Powerapp case management template. The template will work for our needs with one exception. Each record must have a unique and sequential number. I am creating this app to replace a basic MS Access database which cant be converted to work on the web for the long term. So, when a new record is created I need a field, It could be the ID field, to increment to the last record number +1. This data in this field must not be user modifiable. I need this field to be viewable from all data rntry screen and, obviously, included in the filters. I would like to take the template I am currently using and simply make the ID field vieable on all screens if it will correctly increment. Or, if that will not work I would like to create a field that can perform this function for me. This is my first foray into Powerapps so it is unclear to me how to create a new field in the database record and also how to then make it available on the data entry screens. Any assistance will be deeply appreciated. Jim
Hey is there any solution to create auto increment record directly in CDS?
Im on this screen and each time I just want to create a record with unique ID:
That works until you get 2000 items. Last() is not delegatable.
OH my word. This solved my issue with the simplest of solutions. Thank you so much. This is definitely the easiest method to create an auto-incrementing number.
@fdesouz4
Hi, You can use Last(List Name Here).ID + 1 in your column's data card value default function.
Hi, You can use Last(List Name Here).ID + 1 in your column's data card value default function.
Hi @fdesouz4
My understanding is nvarchar is a text type in Sql. For the PowerApps formula to work property, the underlying dataset field must be an integer type.
i have the same issue, you were able to get a solution?
H Guys
I am using this code in the default card to increment the ID by 1. But it stops at 10. The field in power Apps is set to a number and the column the sql database is set to a nvarchar.
First(Sort('[dbo].[Test_App_Staff]',PersonID,Descending)).PersonID+1
why does it stop at 10 ?
any ideas please?
Thanks
Hi, I want to build similar kind of power app which increments the suffix numbers. I am having mutiple apps . eg. BranchApp , CareApp etc.
I need to generate BranchApp2 if BranchApp1 exists , same case will be for CareApp.
Please suggest which type I shoud use canavas type or model driven.
Hello,
I have the same use case mentioned in this thread. My data source is Excel with multiple sheets configured for multiple screens in the power app. For new records all the data is saving properly except auto incremented IDs. Could you help?
WarrenBelz
146,745
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional