Conditional Query for empty fields

Options
Hi all,

Would like to conditionally query for when a particular field inside my table is empty, as per the screenshot below. [image.png]The schema for Account.subscription is an object. Is it possible to query for this? How else would you filter this? 

Comments

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options
    Right now it looks like it is matching to the string "empty" which is likely not what you meant. In this situation there are two things you might be looking for:

    1) An empty string, in which case you are matching to the string blank. Leave it blank, and you will match your test.
    2) If the field is "nullable" (eg nullable is true in the database designer) you can use "=" with null. Make sure the type (the little text in the corner) also says "null", lest it look for the literal string "null." That would be like what you have now with "empty" - not so helpful. 

    I would use nulls as a matter of practice rather than blank strings where I can, but check your database for which is really present. Let me know if I can help more - I saw that you previously reached out at Statechange and I'd be glad to help out 1-1 over there if you like. 
  • Felix Tan-2030210
    Options
    Haha yes, I typed the "empty" there to show my intentions. 

    I would typically use an "is_empty" filter on the db field, but that's not available in conditional queries. 

    Good to know point 1 that you mentioned though. I think I'll use that. 

    Will keep 1-1s with you in mind, but I think open discussions here within members of the community helps contribute to collective knowledge of the Xano community. I've learnt plenty of kinks within Bubble just from camping in the forums and I'd like Xano to have an environment like this too.