CreatAndUpdate Action not working

CreatAndUpdate Action not working

  

Hi all,

I am trying to create or update inputs, but it seems that it is not working as wished. What I created is one screen with 3 steps in it. In those steps there are forms (3 forms in total). At the end of the flow one can submit the forms so that the inputs will be saved. Unfortunately it is not working. I debugged it and all the data is kept until the CreateOrUpdate action. The only thing that will be saved is the Id itself. the rest of the fields are empty. The logic flow of the buttons checks in which step the user is and if all the fields are filled in as expected. If step 3 has been reached a save button will pop-up and the forms should be saved. I am curious what went wrong and hopefully someone can help me with this how to solve it. 





Hi Martijn,

If a CreateOrUpdate Action doesn't save the right values in the database, then the input of the Action (the Entity Record) didn't contain the right values. When debugging, check the values in the input, an trace them back to when they are supposed to be filled.

Kilian Hekhuis wrote:

Hi Martijn,

If a CreateOrUpdate Action doesn't save the right values in the database, then the input of the Action (the Entity Record) didn't contain the right values. When debugging, check the values in the input, an trace them back to when they are supposed to be filled.

Hi Kilian,

Thanks for your reply. I debugged and all the inputs are kept and filled in, but the action will not save the inputs. Could there be something else that can cause a similar issue like this? 



Hi Martijn,

These aren't the inputs to the Action. Every CreateEntity, CreateOrUpdateEntity and UpdateEntity Action has as input a Record of the Entity type (named Source):

So you need a local Variable as input (which you have, otherwise it wouldn't compile) that you need to fill (i.e. assign the Attributes of). You seem to somehow expect that the seperate Local Variables you have automagically populate one of the other Local Variables, but that's not how things work, obviously.

A final, unrelated note: you are creating a Mobile App, but you are storing the data to a Server Entity. This means that every time a user saves, there will be contact with the server, and if it's not available, you'll get an error. This is not the promoted pattern: instead, you should store to a Local Storage Entity, and use synchronisation to send the data to the server.