Favorite or Unfavorite Board

Options
I'm trying to query all my boards and separate the one's that our favorited by the user versus unfavorited using a heart icon. I'm not quite sure how to set this up in the function stack for my db query. I think I need a conditional statement that when the condition is true it will use a heart_fill icon and when its false (or unfavorite) will use a heart_stroke icon.

I'm pretty confident this logic requires an if/then statement, but I'm not sure if my true or false expressions are setup correctly to achieve the desired result. It's giving me an error about the favorite variable, but I don't want to return that. I want it to simply evaluate to true (or false) in the expression, so it can pull the correct image on the front end (bravo studio) using the correct endpoint.

[Screen Shot 2021-09-14 at 9.52.53 AM.png]

Comments

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
    Hey  - it's actually even easier than that. The query all records function can do pretty powerful dynamic filtering. I made a quick example for you:

    


    On a separate note, for some reason I want to say Bravo Studio does not support booleans (you should double check that though as I'm not the Bravo expert). If that's the case, you could use an enum field and define what two values are allowed. 
  • Andrew -1831384
    Options
    Thanks Michael. I'll check out Bravo Studio's functionality regarding booleans. I am curious if you guys recommend a different no-code front end platform? I'm not married to Bravo Studio. I saw your partnership? with React Studio and was wondering if you'd recommend them as a no-code front end for web apps and mobile native apps. 
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
    React Studio is another great tool, it spits out clean react code. We created Xano to be front-end agnostic because we realized there are so many great no code front-end tools out there. Usually we recommend to test some out, research their capabilities vs your app's requirements, and see which one resonates with you. Some other popular ones that our users use besides Bravo Studio and React Studio are Adalo, AppGyver, Draftbit, Bubble, Bildr just to name a few.. 
  • Andrew -1831384
    Options
     - It appears you are correct Bravo doesn't support booleans. I'm trying to test this out for now using Board db where I have a field "Favorite" defined as an enum, but I'm not sure how to define what the two values are? I mean of course it's "favorite" and "unfavorite", but how do I get it to return the correct image? Assuming thats how I want to set it up for now (until bravo introduces state logic?). I need to get Xano to return one image that represents favorite (eg - heartFilled icon) and another image when unfavorite is the response.

    Thanks
    -Andrew