Does anyone know how to fix this error when using set_ifnotempty?

Options

I am trying to edit this data in my project without the fields that are already populated turning blank. I added the set_ifnotempty filter to one of the inputs as shown in the tutorial video in the documentation. However, whenever I run it, I get this error. Anyone know how to fix this? Any help is greatly appreciated!

Answers

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    I think in this case you want to use first_notempty. first_notempty gives you a fallback if, for example, the title is notset. We use it for the "get record then edit record" pattern. You say update to my new variable X, unless X is empty, in which case please update it to its old value from the get record call.

    set_ifnotempty is for updating an object (e.g. set this key if the value I am proposing is… not empty

    These things can get a little confusing! If the above doesn't make enough sense, share where it still feel sticky to you and we'll work the problem.

  • nickolaig
    nickolaig Member
    Options

    Gotcha! That worked. Thank you for the help! Your explanation made it a lot easier to understand :)

  • nickolaig
    nickolaig Member
    edited April 2023
    Options

    I unfortunately added it to all of the variables and for some reason it was only updating the first 3 and the rest were still turning blank. This being "title, description, and category." For some reason now none of them work. I'm unsure as to why as I reverted all the changes to when it was working haha!