Does anyone know how to fix this error when using set_ifnotempty?
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
-
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. -
Gotcha! That worked. Thank you for the help! Your explanation made it a lot easier to understand :)
-
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!
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback