Support Topics Documentation Slack YouTube Blog

Is there a way to CREATE a record if it doesn't exist or UPDATE a row if it does exist?

Hi,
I would like to create a record if it doesn’t exist or update a record if it does exist?
Thanks,
Carlton

Hi Carlton,

What you describe is typically referred to as “upsert”. This is on our roadmap. Currently, the “save” API operation checks if the object you are saving has the objectId property with a value. If it does, it is the update operation, otherwise it is create. The upsert goes further and checks if the object with the specified objectId actually exists in the database.

Regards,
Mark

Thanks. I didn’t know it had an official name. I managed it by checking the data base and then choosing the operational based on the result. It works just fine. I look forward to the update :slight_smile: