The Easiest Way to Edit/Create a Record

What's the easiest way to create an API if I need to edit a record if it exists or add a new one if it doesn't.

I thought of querying all records for a match of the searched columns (other than the id) and if found I return the id in a variable.
If the id is not null I edit the record and else I add a new record.

I tried to do that but I can't get it to work.
Xano complains that it can't see the [variable name].id field.
Working with APIs
8 replies