Check the presence of an object by id
Hi, I'm having a problem trying to verify from the server code that an object exists in a table. I have the potential id and I want to find out if there is already a chat (with this id) in the table (and in case modify it) or the isn't (and in case create it). I tried to use the code below, but still, when it should create the object, it gets an error and doesn't start the create function.
Can anyone help me figure out how to adjust my code or tell me another way for doing this?
Thank you very much