Skip to main content

Notifications

Community site session details

Community site session details

Session Id : wjDnNww+PcCObqqUBxaLTJ
Power Apps - Building Power Apps
Answered

Create Records with Auto-Increment-ID in a powerapp

Like (0) ShareShare
ReportReport
Posted on 11 Oct 2017 16:51:53 by 2

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 

Categories:
  • Z_Lukowski Profile Picture
    216 on 28 Jan 2021 at 13:26:16
    Re: Create Records with Auto-Increment-ID in a powerapp

    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:

    Z_Lukowski_0-1611840366732.png

     

     

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on 12 Oct 2020 at 13:43:17
    Re: Create Records with Auto-Increment-ID in a powerapp

    That works until you get 2000 items. Last() is not delegatable.

  • AA-22080703-0 Profile Picture
    11 on 12 Oct 2020 at 11:19:48
    Re: Create Records with Auto-Increment-ID in a powerapp

    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.

  • Community Power Platform Member Profile Picture
    on 15 Aug 2020 at 12:33:03
    Re: Create Records with Auto-Increment-ID in a powerapp

    @fdesouz4

    Hi, You can use Last(List Name Here).ID + 1 in your column's data card value default function.

  • Community Power Platform Member Profile Picture
    on 15 Aug 2020 at 12:31:29
    Re: Create Records with Auto-Increment-ID in a powerapp

    Hi, You can use Last(List Name Here).ID + 1 in your column's data card value default function.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on 09 Apr 2020 at 18:08:41
    Re: Create Records with Auto-Increment-ID in a powerapp

    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.

  • fdesouz4 Profile Picture
    3 on 09 Apr 2020 at 17:58:02
    Re: Create Records with Auto-Increment-ID in a powerapp

    i have the same issue, you were able to get a solution?

  • goldstoned Profile Picture
    12 on 29 Feb 2020 at 12:48:58
    Re: Create Records with Auto-Increment-ID in a powerapp

    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

  • AzureLearner Profile Picture
    15 on 29 Jul 2019 at 06:05:38
    Re: Create Records with Auto-Increment-ID in a powerapp

    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.

     

  • Community Power Platform Member Profile Picture
    on 06 Mar 2019 at 17:34:34
    Re: Create Records with Auto-Increment-ID in a powerapp

    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?

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,745 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard