Hiding data in PATCH call

Options

When making a Patch call that edits data within an object, in order to ensure the data does not end up "null" or "false" i have to input the existing variable's data within each data set.

Is there a way to not have to input the existing variable's data?

Even when i hide the data from the API it still sets it as "null" or "false" when making the call.

Answers

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options

    Hi @JayyyTeee Xano performs full object replacements, if you want to conditionally edit fields based on the presence of a value for an input, you can use the conditional set filters:

    note: that false is not considered an empty value so you would need an actual conditional for booleans.

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options

    re"Hiding": you would also need to hide the fields in the edit record function - that's what's most important and what is actually doing the editing. So you could have an API designed to only edit certain fields by utilizing this

  • gbdoin
    gbdoin Member
    Options

    Is there any functional difference between the way Xano handles a PATCH and a POST?

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options

    @gbdoin The endpoint functionality is handled within the function stack. So for example, the Edit Record function does not change functionality depending on the HTTP verb - Xano still performs complete object replacements.