web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Can't create new recor...
Power Apps
Unanswered

Can't create new record on Edit Form

(0) ShareShare
ReportReport
Posted on by 65

I have an edit form bound to a mysql database. I can edit records fine, but I can't create new records unless I display the id field and enter something. id is the key field in the table and is set to auto-increment. I set the required flag for the field to false and it still doesn't work unless I enter a number in the id field on the form. 

 

Ideally, I wouldn't even show the id field on the form and it would just be created and auto-incremented when the record gets inserted. What am I doing wrong?

 

Thanks!

Categories:
  • v-monli-msft Profile Picture
    Microsoft Employee on at

    Hi @kman42 ,

     

    If you cannot create new record, did you encounter any error message while submitting a new record via edit form? 

     

    You could add the id field to the edit form, then set its Visible property to false and then have a try.

     

    Check if below thread has any information that might help:

    https://powerusers.microsoft.com/t5/Expressions-and-Formulas/MySQL-ID-Field-required/td-p/242796

     

    Regards,

    Mona

  • v-monli-msft Profile Picture
    Microsoft Employee on at
  • kman42 Profile Picture
    65 on at

    I'm still trying to create a workaround for this issue. I'm trying to set the default value for the id card to the parent value if the form is in edit mode and to the max value of the database field +1 if it is in new mode.

     

    If(NotesForm.Mode=FormMode.New,Max('[notes]'.id)+1,ThisItem.id)

    This results in:

    The function Max has some invalid arguments. Invalid argument type (Table). Expecting a Number value instead. 

     

    id is an integer.

     

    Thanks!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard