Skip to main content

Notifications

Community site session details

Community site session details

Session Id : /6VlrdRcp77HT9XldvzdjN
Power Apps - Building Power Apps
Unanswered

Autoincrement on PK / problem with MS SQL DB

Like (0) ShareShare
ReportReport
Posted on 30 Jun 2021 18:45:00 by

Hi,

 

I have a table in a MS SQL Server DB which has a PK and setup to autoincrement (integer value):

 

stpauli_0-1625077138510.png

However, my Powerapp - where I use the patch function to create a new record complains about not proving this key. I have refreshed the DB source connection, removed and refreshed it, but I is still complaining about the missing field an throwing an error.

stpauli_1-1625078378887.png

What I am missing ? I thought and that is what I am reading from other posts that unlike for other DB types (e.g. Postgres, MySQL) this should be possible out of the box with MS SQL. Or is my understanding wrong?

 

Appreciate if someone can pinpoint me to solving this issue!

 

Cheers,

 

Udo

 

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on 30 Jun 2021 at 19:20:27
    Re: Autoincrement on PK / problem with MS SQL DB

    I agree.

  • Community Power Platform Member Profile Picture
    on 30 Jun 2021 at 19:16:47
    Re: Autoincrement on PK / problem with MS SQL DB

    @zmansuri thanks for the research...I read that post you provided also earlier, but I thought some solution must be out there, because I also came across this post where the user claims not having had an issue with MS SQL:

     

    postgresql - PowerApps Postgres auto increment ID - Stack Overflow

     

    But reading through your posted thread a bit more user still (this year) complain about the missing support for  this. So I guess I have to get rid of the autoincrement and determine the next value myself as a workaround...😒 that is pretty lousy considering that we are in year 2021 where 20 years ago this was possible in php or coldfusion etc. etc. I do not get it...

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on 30 Jun 2021 at 19:05:41
    Re: Autoincrement on PK / problem with MS SQL DB

    Ok i searched it. 

    PowerApps connection to MySQL: id issue - Power Platform Community (microsoft.com)

    This post is from 2019. i am assuming issue still exist.

  • Community Power Platform Member Profile Picture
    on 30 Jun 2021 at 19:02:43
    Re: Autoincrement on PK / problem with MS SQL DB

    Hi @zmansuri ,

     

    thank your trying to help! Really appreciate...I tried that and it is coming back with a type error (text instead of expected int) 🙄:

     

    stpauli_0-1625079663579.png

     

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on 30 Jun 2021 at 18:53:47
    Re: Autoincrement on PK / problem with MS SQL DB

    I haven't work with SQL. But, try this add id columns syntax with patch in the value just write ""

    Like   {ID:""}

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!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard