Distinguishing between input not passed on vs. passed as empty

Hi all,

For a patch request, I'd like to be able to change a record in my database as follows:

  • If the front end passes on a query parameter with an empty value ("" as string), then delete the field's value in the Xano database

  • If the front end does not pass on the query parameter at all in the request, then preserve the value that is currently in the Xano database (do not delete it).

  • (And of course if the front end passes a parameter with a new value that is not empty, then update the value in the Xano database.)

I tried using set_ifnotempty but the problem is that it does not distinguish between a parameter passed on with an empty value and a parameter that was not passed at all in the request.

Any ideas how i can accomplish this?

Thanks!

6 replies