Search code examples
google-app-maker

Google AppMaker Id (primary key) missing or null on Save


I have a datasource in manual save mode. When I create the item and persist the changes, I get an error message, saying Id field is null. Id field is the primary key and hence cannot be assigned through front end. Any ideas why AppMaker thinks it is missing.

enter image description here

Code is this

widget.datasource.createItem({
  success: function(){
    app.datasources.CountyManualSave.saveChanges({
      success: function() {console.log('yey');},
      failure: function(e) {showSnackbar(e.message);}
    });
  },
  failure: function(e) {showSnackbar(e.message);}
});

Here's the image, that shows it is the primary key. Doing the insert through the Mysql client works without problems.

enter image description here


Solution

  • I am not sure what was wrong but I unclicked the auto increment and reclicked the auto increment under field Id. Previewed again. Things worked. I am leaving this question here in case somebody questions their sanity. This is to show that environment is not always stable.