cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dhofknecht
Level: Powered On

Auto-ID Not Displaying in Edit Form

Hi,

  I've got a SQL Database linked to my PowerApp and my autoid isn't displaying on the edit form when creating a new item.  It is generating fine but is there anyway to get this to display when opening up the edit form to create a new record?

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: Auto-ID Not Displaying in Edit Form

Hi @dhofknecht

 

I do not think it is possible. The autoID is only created then the database receives a request to add a new record so PowerApps has no way of knowing what ID it will chose to assign to newly created record.

 

This is assuming you are using something like this for your auroID column in SQL:

autoID int IDENTITY(1,1) PRIMARY KEY

 

On the other hand, you could display the fake newID which you think will be generated.

You can get LastID from database and just add 1 to it to assume the ID to be generated and display it on the form if you want your users to see the next ID to be added.

 

To get last ID you can utilize Last() function

Last('[dbo]'.'[MyDatabase]').autoID

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Re: Auto-ID Not Displaying in Edit Form

Hi @dhofknecht

 

I do not think it is possible. The autoID is only created then the database receives a request to add a new record so PowerApps has no way of knowing what ID it will chose to assign to newly created record.

 

This is assuming you are using something like this for your auroID column in SQL:

autoID int IDENTITY(1,1) PRIMARY KEY

 

On the other hand, you could display the fake newID which you think will be generated.

You can get LastID from database and just add 1 to it to assume the ID to be generated and display it on the form if you want your users to see the next ID to be added.

 

To get last ID you can utilize Last() function

Last('[dbo]'.'[MyDatabase]').autoID

View solution in original post

mx
Level 8

Re: Auto-ID Not Displaying in Edit Form

re: "You can get LastID from database and just add 1 to it to assume the ID"

Last('[dbo]'.'[MyDatabase]').autoID

Unfortunately, in a multi-user database, that is not really reliable - since another user may have added a new record in the split second before the Last function is executed via PowerApps. 

DatabaseMX ('mx')
Microsoft Access MVP

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,005)