hi everyone my name is christian i've been interning at xana for a couple months now and i'm excited to share with all of you my first tutorial video in this video i'm going to be creating a to-do list uh using weweb's end and connecting it to my zano back-end weweb is a drag-and-drop user interface that sits on top of your xano database you can think of it as a website that users can interact with we're going to use zano's api endpoints to authenticate users and allow them to populate records in our database now there are
three things you're going to need in order to start this we're going to go ahead and head over to the marketplace in zano and you're going to want to pick up this starter template once you're done with that one we're going to want to scroll down and grab this to-do list template lastly we're going to need a weweb.io account so sign up log in and we're going to create a project together but first let's go ahead and see what we get out of these templates head over to the database and let's go over to the
to do one so you see this table is already filled with some dummy data but we're going to want a little bit more from this so first we're going to want a table reference to our users and right now i have a couple users so i'm going to go ahead and put myself right here and the next thing we're gonna want is i want people to be able to store images in this to-do list so let's go ahead and call this image next let's do a text one and call it category and lastly let's do
due date so i've authenticated this uh this record right here to myself uh order pizza for dinner i'm gonna go ahead and throw in this image of a pizza as well but we could leave category and due date blank for now now let's see what the api has for us so this is all from just the template and that user was something i had put in previously but you may have your own users or you may just have the dummy data users that the star template comes with in either case let's go ahead and see
what this get to do api endpoint looks like so first things first i want to delete this search actually because i don't want my users to have to search for anything in order to see uh what they're authenticated to i want them to be able to just see whatever records they have in the database um next thing is i want to be i want to change this custom query right here and i want the to view dot user id oh it's right there uh to equal and go on to the off i wanted to uh
equal the auth id and what this does is just another layer of protection to make sure that users only see what they're authenticated to all right that one looks pretty good let's go back and let's make sure this is actually authenticated and we can go ahead and do that with this one as well um actually you know we'll worry about that later so one thing i almost forgot let's go ahead and go back on to this uh get to do uh click on this function stack right here i'm gonna head over to external and we
can just go ahead and delete this because again we're not searching for anything users are just going to see what they are authenticated to the next thing we want to do is we want to head over to weweb.io so i'm going to go ahead and login and i already have a workspace and for you guys who do not have a project yet uh go ahead and click this create or duplicate project and all i've done so far is i've just created this basic layout template so that's what i'm going to go on to right now
and i've just already named it zano tutorial but it's just the basic layout let's see what we have alright so if you click over here onto this pages right here we can see there are four pages and we're not going to actually need to worry about three and four we're going to end up deleting those but let's go back to the login and once we're here we want to click on this puzzle piece up here and we want to go down to authentication and grab this zano auth plugin so we're going to need to go
back into xaml and we're going to need to get the login the get me endpoint and sign up endpoint and we're going to need to paste those urls right there so going back into zano and going this is in our starter template so it's under the basic auth so you can go ahead and click this button and copy the endpoint so this is the login so we just paste that right here me endpoint and the sign up endpoint all right got those all good and we want to make our home page just the login home
homepage uh and right here we're just gonna call it roll all right cool got that all set up now before we can get users to see what they're authenticated to we need them to be able to log in and get authenticated in the first place so i'm going to go ahead and get started on that workflow so clicking on this button up here this is how we're going to be able to make edits to our uh web page click on this little lightning bolt that's our workflow and actually i want it to be on make
sure it's uh this entire form container and if it's not on the form container it will yell at you and tell you that you're not on the right thing like if i try to go on this login button you're going to see this and it'll automatically send you to the entire form container so now we can create the workflow for logging in to zano through we web and the template the basic layout template that we had chosen with weweb automatically sets this all up for us so all we have to do is choose our action
right now and we want to hit this login uh request and this is actually the api endpoint that you put into we web just a second ago um so it's gonna use that basic auth uh login uh from the starter template and weweb automatically knows in its signup or in its work form uh which is the email and which is the password so we're going to use that email value and we're going to use this password value and once we have a user logs in [Music] we want to change the page to our to-do list
um now i haven't created that yet so let's go ahead and create a page right now and we'll call it to-do list uh we can do that there we go and this will be to do and we'll just have it created from an empty page for now all right head back over to log in and we still need to actually put in that page all right so now in theory if you have a a user right now in your xano database you should be able to log in and it will send you to the to-do
list if you don't we'll create the sign up process so that you can create a user and do that exact same process all right so let's go over to the sign up page and same thing we're gonna click on this workflow right here and this template automatically calls it login but we'll rename it to sign up because we are on the sign up page and we'll call this sign up to zano and again this is the basic off uh sign up endpoint url that you plugged in earlier so we're going to go ahead and grab
the email variable the password variable and the name and once a user signs up uh and gets submitted into your zano database uh we want to log them in to their uh to-do list so let's go ahead and do another action a login action grab those same variables email and password and one more action we're going to change the page to that to do list all right so i already have a user uh of myself um so i'm gonna go ahead and do the login page if you don't have a user um make one right
now uh enter in the password email address it'll automatically update into your zano database and you'll be able to be sent to the to-do list so i'm gonna go to login and i'm gonna sign up with my own user that i have uh myself and enter in the password that i know and logging in we are sent to our to-do list a blank page but you did it all right so let's go ahead and delete these two pages three and four um if you remember i said that we don't need these two i'm not going
to worry about them and they're just kind of taking up room right now so in order to start our to-do list let's click on this add new section we're going to throw this section right here uh going back into the of this plus button right here uh we're gonna throw this kanban and that's actually going to be our to-do list so let's go ahead and include everything uh it just has dummy data as well start with all right so in order to get authenticated data to be displayed on weweb we need to use that get
to do api endpoint and in order to do that we click this button up here and we're gonna add a plug-in so we need to add a data source plug-in so grab this zano data source plug-in and you're gonna need your zano api dev key so we web is kind enough to have a link to our docs on how to find it i happen to have mine handy so i'm going to just put it in right here and i'm on a free instance so nothing fancy here and we're gonna add this collection so i'm going
to call it user data and our source is zano and as i said we want to go into our to do api group and we need to use that get api as i said earlier and right here you can see that we have one item and it's that order pizza for dinner item cool so let's go ahead and finish that up and so we still don't see it and that's normal uh we haven't actually changed any of these elements to display the right data but weweb now has access to our uh data through that api
endpoint so in order to stop displaying this dummy data in weweb let's go ahead and click on this navigator right here hit this drop down and we can see this is our all the page elements right here uh go ahead and click on that one oh we need to go into the editor uh right here under kanban and on this middle column right here we see this specific kanban fake items that's our dummy data well we don't want to display that we want to display our users data and now that we added this collection in
weweb we can see that right here so let's go ahead and actually do our data and want to stack it by our category now we still don't see it but if we add this uncategorized stack well now we happen to see an item one thing to note if you uh don't happen to see anything here make sure that in your xano database you have authenticated this to the user you you signed up with or logged in with once you do that if i were to change this i wouldn't see this anymore i can create an
entire new record right here think water and we'll go ahead and say it's important and we're going to authenticate it to my steve jobs user in my user database and or my user table and i'm gonna put this uh this here and we can go ahead and add um type in work in progress wip right there and that'll actually shift it in we web as well um shift the card that is and right here as well sure we'll we'll have both of them as work in progresses um all right so now if i go back
here and i update this as you see uh so in progress we have one item and only one item if i uh had not authenticated that i would see all items so that's why this authenticated data is very important so let's go ahead and start looking at the object or looking at our data now so i'm going to go ahead and go into this navigator i'm going to go all the way down and until i see image right here so it's inside let me just close those for clarity it's inside this item stack and here
i'm gonna hit this plugin button and i want it to grab the image url uh that's there we go the image url and now we see some nice pizza all right so we can do the same thing with pretty much everything else uh you can also click on the element if that's faster for you um so let's go ahead and just delete all that and we want the task name to be right there to display all right so now we got ourselves a nice pizza card that says order pizza for dinner the next thing i
want to do is i actually want to click onto this icon right here and i'm going to create this color so click this button right here these six little dots in the corner i'll create a color i'm going to call it gray and i just want it exactly as it is and click that button one more time and i'm gonna want to create another color and let's go ahead and create an orange color uh more orange there we go that's that's gonna be good the reason why i'm doing this is because if if uh my
item is marked as important i want to actually change that icon's picture so i want to display orange if it is important and the way to do that is actually by going into this color statement right here and we're going to go ahead and do an if statement right here so if the item is important and that is uh if that is true then we're going to go ahead and go into our colors right here under this middle one and go under colors and if it is important we're going to display orange and if false
we want gray so in order to tell if that's actually true we have important right here and it is marked as important so it is displaying correctly however just to test that let's go back here unmark that and refresh the page and we should see that it's a gray lightning bolt now and it is in fact a gray lightning bolt so i'm gonna go ahead and mark ordering for pizza as important refresh one more time and we will see an orange lightning bolt appear awesome now i'd like to make a note that this exact process
would be done for the complete icon as well if we wanted they somehow show users that something was complete we could set this entire process the exact same way so i won't be covering it twice just know that you can do the same thing add an icon onto this card change the color if it's complete with that exact same logic as before one thing to note that you might have noticed is that wherever our card is it's actually getting rid of this ad card and that's because the ad card uh has a little bit of
logic with it to start with in kanban and we're just gonna go ahead and get rid of that because i want that card to always appear um sorry you just unbind it alright so now this add card will always come up if we just unbind it and leave the display on so one last thing we want to add into this card is actually displaying the due date so if you remember i made it a text so we're gonna throw in this text ui and we're gonna go ahead and click on it click this under specific
change the plug to due date and right now in zano i don't have a due date but if we go in here and i'm just going to fill it out as today not 2002 and now just update this we should see it display uh august 26 2022. so now that we have uh and every card will actually follow this exact exact formatting that we've just set up now we want to form the ability to create new cards all through we web we don't want to be going to zano and creating cards like that so we
want users to be able to create their card right here so i'm going to go ahead and grab a form container right here and we'll just throw it off to the left right here so now that we got our form container let's go ahead and start filling it out with everything it needs there we go and you're going to want to drag and drop this right on top of it just like that new card form and right here if we click on the short answer and go into the middle column we can actually change the
uh the placeholder text right there so i'm going to call it task name the other things we need in this card form is uh important the due date and the image upload so that users can upload all this and create a card on their own so we're going to go back into our elements and the next thing is we want a um a check box we want to just throw that right underneath double clicking this one you can change the name and i'm going to say hi priority uh question mark so if this gets checked
it'll be marked as important in our zano database we want to throw in another element and i'm going to scroll all the way down to this date picker one sorry if my camera gets in the way uh all right so we're just throwing it right underneath this priority check box and this will allow users to submit a time that will be displayed right here and last but not least we want them to have the ability to upload a file and that's going to be right here under form file upload and just like that we have
our new card form complete and click on this eyeball and we're gonna see this new card form and i want to just type in something for now so that we can at least see it when we start editing stuff um so i'm just gonna put apply sunscreen uh i'm going to say that's important and i'm going to mark it as i want to do that on wednesday the 25th uploading a file i happen to have a sunscreen image just handy so um we got that all filled out now we're gonna actually go ahead and go
into our zano database go into our apis and go into our to do api group in this api group we're actually going to need to start editing this to do post api um one of the first things we want to do they actually want to change this image um we're actually gonna have to recreate everything in here unfortunately but that's okay um that's just the way the template works so let's start from the top uh first things first we want a user id number this is under integer uh next we're gonna want a text field
called task the next thing we'll grab the due date let's go ahead and put in a boolean and that'll be important one more boolean and this one will be complete and again i'm not really covering complete too much in this uh tutorial but that's okay it's pretty much going to be the exact treated the same way as important um if you want to do it yourself another text category and lastly we want to go into this storage and we want a file resource and call that image so i'm going to throw in some logic into
our function stack and i'm actually going to just delete this one just for it'll make things a little bit easier if we make it ourself um so the first thing i want to do is i want to go into this data manipulation and i want a conditional so i want to say if our image is not null then we want to create image metadata oh saving the image metadata was created and it's stored as a variable and now we can add a record to our to-do database and make sure everything is correct in here because
i did have to remake it all [Music] and we can actually always leave this as false um again you'd handle the logic here on we website and you would just send an api to change it um which we'll cover later on um this image should be the variable that was created from creating the image file the metadata i should say all right and if there is no image then we'll have to create a record without the image in our to do uh our to do table so we're just gonna actually blank this one out and
make sure the rest are just the same and we're going to save that one last thing to make sure is let's turn on authentication to make sure that only authenticated users can post into our xano database and create cards and now that this api endpoint has been created uh we're going to go ahead and head back into we web and we're going to start editing this new card form container we want to go into its workflow so the first thing we're going to want to do is we're going to have to change this to unsubmit
so we're submitting the entire work form you don't want it to be on click of the button for the new card form you want to be submitting that way you can grab all the values and our first piece of logic here is going to be a pass through condition where we want to see if there is an image being uploaded so we're going to go ahead and go into this function button right here and if there is a uh file then we're gonna mark it true and if there isn't then false and it's true right
now because if you remember i put in that sunscreen uh from earlier and so it knows that there is something there at the moment i just haven't done anything all right next thing we want to do is we want to upload a file so in order for zano to get the uh image we have to first send it to them before we can actually do the post uh logic or api call i should say um so doing this action will upload the image to zano before we actually do the post and make sure that it's
correct so next thing we want to do is we want to do a zano api request we're going to go ahead and go into our to do api group and then we will do the post make sure it's not the post id the one that we edited was just post to do so uh let's start marking down our fields our user id if we want to go into here and we can pick up our zano authenticated user id and this number correlates with if i go over here into zano my user database you can see
right here that i am user number six and that is where we're getting this and this is all done through the zano authentication plugin um all right so the task we want the value that's written in the short answer value and i should have renamed these to be more clear on what they were um but filling out this you can kind of tell what it is so our short answer is actually our task our due date is going to be our date picker value important is going to be the check box value and i had
it checked as true at the moment complete we always want it to be false because um when you first make a card you can't i mean there's no point in creating a completed card i guess category we want this unbound for now i almost almost forgot that uh in order to actually get our image uh value what we have to do is we have to first send it to zano and you can see it was a success i sent that sunscreen image to uh my zano and now what i'm going to do is i'm actually
going to go into this lightning bolt and from this action right here action two because action one is this pass through condition i want to grab the url and that is actually uh the image right there and you have to do this with how zano uh stores images um this is the best way all right and so as you know um as you have seen we've left category blank and complete is false all the rest are filled in with their associated values so there's only a couple more things we need to do inside this workflow
uh but before i can do that i'm going to have to start being clear on what's happening so this will this workflow will be called submit new new card and this action will actually be the submit new card as well because this is actually the api that's going to handle submitting a new card to zano and then i want to actually go back here and i need to rename some of these so that they're more clear so go into the navigator go inside the form container and we're going to hit this short answer one we're
going to call that task this check box should be named important image upload oh i already actually renamed that one um but go ahead and if this was normally i think file one uh i renamed it to image upload and this will make it easier to um see these uh variables inside of our workflow so let's go ahead and do this now so what i'm going to do next is create a bunch of these reset variables values and basically what it's going to handle is when you submit a new card we don't want that old
data to remain so we need to reset these back to their default which should be a blank slate or what have you um and important so that handles all of it our task value whatever is submitted in that new card form our image upload uh we want all these things to go back to being blank once we've submitted something all right and last but not least we need to do one more zano request actually it's not a nano request my bad it's actually a fetch collection because you remember that that collection that we added which
was user data this is actually how people see uh what they have their records um so we need to update or upload the uh web page whenever something gets submitted so that they can see what's been submitted so in order for us to be able to actually submit a card and then refresh it with this fetch collection we're gonna have to do couple things that i forgot to do uh sorry about that head over back to zano and we're gonna go back to the api and go to the to do uh api now in here
there was a couple things i forgot to do um and that is first in this create image from file i forgot to actually set the image file as um as our value and that's very important another thing is uh you'll want to delete whatever's in here and just save it just like that the last thing we'll want to do in order to get this to submit is head over back to we web and we're going to actually create a variable so right here under this little button right here create a variable and we're going to
call it get category because we have it currently that category cannot be null and we're going to want to save it and it's going to be a type of text and this is just in order for us to see that the category does get submitted and or well just see that the card gets submitted so back into our submit new card button if we fill in that variable as uh get category now and so now when uh category is filled in with this get category and everything has been fixed on the zeno side uh we
should oh i have to refill this and make sure if you are getting any kind of errors make sure to go back into the login page and resign in with your user because the authentication only lasts for so long so it could be frustrating um if you are making these edits and you attempt to submit it the same time i do and it's not working for you always try this first um just re re-login because uh it just lasts only for so long so we're going to head back into there let's refill this out together
and reapply this and i'll do it in the work form before submitting the button uh so we have our sunscreen has been uploaded to zano and we have a success on the new card i'm sorry if if this was frustrating for you guys if if you were being signed out or logged out um you do have to go back and relog in if you've noticed like 401 errors especially that usually means your authentication has been timed out and you'll have to re-log in all right so now if we run all this back in our page
we see an uncategorized uh right here uh sunscreen and i can actually submit this right now and we should see another one pop up right there awesome so right now the category is blank um we will have to fix that so we want a user to be able to press this add button and we want it to go under whatever category they press the add card button corresponding with so we're going to have to add some logic into the add card button so let's go into the workflow and on click we want to change that
uh category button that we grabbed earlier with our item value and make sure it's the value not the label because that's going to be the one you want so now we fill in the category label and if we go back to this submit button let's just hit here apply sunscreen actually um we'll have to click this click one of these add cards so i click the to-do one apply sunscreen and we should see it appear under to do there it is awesome that is really good um actually one more thing then we'll want to uh
go into here and we'll want to make sure we actually reset that value as well um every time so get category we'll reset it once we submit it so that every time when we click on a new button um something new so if i click on this one apply sunscreen should head over to done and now if i click on another button it'll head to that one as well so i'm going to really click quick clean up my workspace uh so it looks better for you guys so i just quickly went into my zano database
and deleted all those uh sunscreen ones uh it's just so it looks better uh and it's easier to work with so right now what we wanna do is we wanna actually make another variable and this one will be called show new card form and we want it to be a type boolean we don't always save that one in our storage and we're gonna go back into the workflow of this uh button here and when we click this we want that show we want to change the variable value of that show new card uh to become
true so if we head back out here and we click on this guy our new card form a container we want to go into this button right here and click on this display plug and what we're going to do is we only want to see the new card form when somebody clicks on add card so what we do is we change the display to be based on the show uh is there a search oh right here show new card so once that gets clicked we now see it and currently there's no way to reset it
but we'll fix that so just as a quick recap uh we've created the ability to create cards and records in our zano database and when you grab one of these add card buttons or click them it now grabs the category associated with it and stores that as a variable which then uh is stored in our zano database so the last thing we need to do well not last thing i should say uh we need to grab a new element and i'm gonna grab an icon i'm gonna throw it right here on the side of this
new card form and i want its alignment to be top left and let's go ahead and actually change this icon we're gonna go into hero icons and i want something that looks like a back button so i'm gonna grab that one right there and i want this one to have workflow of changing or resetting that show new card now when you click that it'll reset it back to false which we won't see the submit button or this submit new form anymore so clicking that of course we need to uh also give it its own but
adding a card will bring this new card form back up and clicking that back button will get rid of it let's go ahead and also change the display for this uh back button to be associated with the um show new card button or new card variable show new card there we go so now when we click this back button cool everything goes away when we don't want it to be there and just as one last thing uh you can go ahead and go into display and change this cursor to actually a pointer and so now
you'll actually get a little bit of feedback in that you can now do that cool all right so the next thing we're going to want to do is go ahead and click this add new card button and we want to actually grab this icon again and we're just going to copy it and we want to paste it right next to that icon or to those three dots right there and as you see it pastes it on all four of them as i was telling you um anything you do to one card it does it to
all of them so that's a really handy thing we are going to have to go into the logic and change it a bit because we don't want this back button to have anything to do with this one but first let's create a couple new variables um so we're going to want show options so when somebody clicks on those three uh black dots right there we basically want like an options thing and that's where these back buttons are gonna come into play uh so this is gonna be also a type boolean save it in storage and
one more boolean and it's going to be called delete card all right the next thing we're going to want to do is we're going to want to grab a button and we want to put it right there and we're going to go ahead and double click this i'm going to call it delete card and we're gonna give it a red background um and if you don't have that color you can just make your make it yourself of course um next we're going to want another icon we're going to want to put it right about there
oh that's not right let me delete that one uh how about right there that's fine so if we go into this one uh this little icon right here we want to x and it's right there to the right it was on the web we web icons and just right here and we're gonna want that color to also be that same red so now we need to go into the workflow of this uh three black dot um icon right here and what we want to do is we want this when someone clicks it to have those
buttons appear as options so what we want to do is we want to change variable value of uh show options to become true and and what we'll do is we'll have uh both of these two icons or this button and this icon will have their display uh be dependent on that variable so if show icon or show options is false then we don't see it if it's true we will see it and grab this one as well and this is exactly what i was talking about how we're going to want to change the workflow in
this so we don't actually want to say that what we want that to do is uh show options reset the show options not the show new card but the show options we want to reset that all right and so now if we go into here let me click on that so now we see this delete card we'll also fix that um that back button right there but we need this delete card to show up because we need to add a workflow on it and we need it to change a variable that'll be delete card to
become true and we also need to display this we want this one instead of being the this is the back button so instead of this show new card form to be the dependency for the back button we want the dependency to be show options just like uh the delete button so now if we click that now if we click these black dots it shows these two buttons last but not least but we need to change this red x to only appear if we click this delete card so we'll change the display to be a variable
uh i hate that delete card there we go so if delete card is true then it comes up so when we click that now it shows up because we added that workflow oh i also want um in the workflow of this arrow to not only reset the show options but also reset the delete card reset variables and let's reset delete card cool so now when we click this black dot button everything disappears and if you click this delete card button then this red x appears and now we just need to add the workflow in this
red x so when we go into the workflow of this red x we want it to be on click and we want to make a zano request we're going to go into that to do uh api group we're going to go ahead and hit that to delete and we want to delete the id that's associated with this card so what we do is we just go right here item data id make sure it's not the authenticated user's id because that would delete the wrong card we only want to delete the card that they clicked the
button on so now if i were to click this red x button which i guess i'll just do uh oh forgot one thing need a always refresh fetch a collection and user data that way uh we always need to add a refresh whenever we make an api call that either changes adds or deletes something you always need to call that fetch collection so if i were to refresh this page it will be deleted i can add another one just to show you that it works exactly as intended so as we see that is gone um
and we can actually add a workflow uh that will have everything reset every time we uh open up this page but let's go ahead and add a new card we're going to go ahead and create a new record um oh i already got it started up right here and let's go ahead and submit it and we should see it appear right there uh where i click the add card button and now we're gonna get into uh being able to edit certain things about this so first things first let's actually delete some of the stuff we're
not using right here like that icon and uh that one and i sh you probably would want this to be actually this text group and vice versa um but that's okay uh you guys can make this however you want it i'm just showing you the functionality and how to do certain things about it so anyway when we click on this little icon we want to be able to change uh make an api call to zano to change its category which in turn will change the color of it so if i head over to zano i
head over to the to do api group i want to actually make a new api and endpoint in the to do one and i want to be in edit i'm going to rename this to do change important i want to be user authenticated and before i go into that i want to make one more and it'll be called to do change category so we wanna we want users to be able to change the category and change whether something is important or not um the important will go with the uh the little icon the little lightning
bolt icon and changing the category will change where they are in the stack so let's go ahead and let's start with important so what do we need well we don't need the task we don't need to know if it's completed or not we should get the user id we should get the id of the card and we should get the boolean of important because we want to be able to change the important so everything else we can just make hidden from the api text alrighty and now that we only have the inputs that we care
about let's go into the function stack and do the same thing where we only want to have the things that we care about and right there it's the we care about the id we care about whether it's important or not and we care about the user's id because we don't want a different user being able to edit another user's cards if something like that were possible all right so everything's saved here so let's head over to the change category and let's do the same thing so we're gonna go ahead and make this task invisible because
we don't care about that when we're changing the category completed doesn't matter this important doesn't matter the user id we care about this we don't this we don't care about and lastly we don't care about that and i just realized i didn't make the uh category hidden my mistake got a little ahead of myself got a little excited um so this is the change category make sure that category is not hidden but we do want to hide the rest of the stuff that we don't care about user id due date image so we should have
category is not hidden user id not hidden and the ids not hidden so now that these api endpoints are created on zano's side let's go ahead and go back to weweb and add the functionality here so i'm going to go ahead and click on the icon right here this little orange lightning bolt and i'm going to add a workflow to it so i'm going to change a variable value and i actually haven't created this value yet so let's go ahead and do that together click there is a little plus button that you could create a
variable or you could just go up here and do it the old-fashioned way and we're going to call this important and it's going to be a boolean and that's fine save it in local storage and basically what we want to do is once we grab the important value we want to uh give it a little logic so if i click on an orange lighting bolt i want to set it to gray or unimportant uh if you remember orange is important gray is unimportant so what we need to do is we need to make a little
switch statement so go ahead and go in that function click switch and what we're going to do is grab the important value or yeah the the item data is important and what we want to say is if it's true if it's true set it to false if it's false set it to true that way every time we click it what it's going to do is just change that variable value uh that boolean value once we've created this uh variable and gave it its logic we're gonna go ahead and make that zano request api call go
into the to do api group and we're going to go ahead and call the change important so what we need to do is for the to do id we need to grab the id of the card we want to change and we need to grab that important variable that we just made because with that logic it'll change it every time we click it and last but not least let's grab the user's authentication id number and always always always fetch your collection refresh the page oh that's wrong not the right one fetch collection not fetch user
fetch that user data because this will always refresh the page so if we didn't have this we wouldn't actually see the orange change the gray or the gray change the orange we would just have a it just wouldn't change um it would change on xenon side but not on we website so we need to always refresh the page whenever you make a change like this so now if i go here and click on it we see that little lightning bolt change from orange to gray and we can change it back and forth so the last
thing we need to do is we need to have if i move a card over to this section i want it to change its category in zano uh to the category that it's associated with now not the previous one i don't want it to be a work in progress anymore if i move it over to done and i don't want it to be a to do if i move it to in progress so i need to add a little bit of workflow so go ahead and go on to this single stack and we're going to
add a workflow and before we actually get started let's create a new variable we're going to call it moved card this is going to be a object type and go ahead and save that so what this is going to do is oh well first we want to change this uh this here trigger we want to change it to on item added and what that will do is when item gets moved and added onto a new stack uh we're going to grab grab that card uh change variable value i want to grab that new moved card
value or variable and i want to set it to the event item and this won't grab anything at the moment because nothing's been added but just just roll with me for a second here we also want to change the uh get category so get category i want to take change it to the uh the new category that it's being moved to and once we do that we're going to make a xana request we're going to go into that to do api group and we're going to go into that change category one that we did earlier
so we're grabbing the id of that card so it should be oh this is the part so what we need to do is actually move a card in order to do this workflow and now we're gonna go back into it and we see now it's actually grabbed a card because we've moved one um so now what we can do and it's it's stored it into these variables we stored the category as well and we want to grab the moved card right here and we see it's the i mean it's the only card but it would
grab whatever card you moved and we want to grab the id number we want to grab the users uh authentication id and we want to grab the category of get category so otherwise if we didn't grab it from this move card we wouldn't be able to see which card it was that got moved so that's the whole purpose of this object and so now if i move this card it should be in theory done in our zano database so let's go over to this to do and now we see its category is done instead of
a work in progress so heading back here a little recap users are authenticated and can only see what is authenticated to them as you saw in my zano database i never once saw this uh this card um if i were to log in in fact let me just do that right now uh let me go to the login page and you might have already done this yourself just to be sure i'll sign in as my steve apple and look at that he has a completely different database uh that he's reading from i mean it's not
a different database but he's authenticated to different items in the database users can click on this add card they can create cards themselves they can read the card they can change uh the functionality and actually i didn't mess with this too much but it's pretty much the same idea all you have to do is go into this navigator you navigate to it it's this bottom one right here and so all i would do is navigate to it um as you can see it's this very bottom one go into the details and then you grab that
image you go into the specific and all you have to do is click that same plugin button and you can go ahead and go into the user's data and you should be grabbing their image url just like the other ones and as you can see it's a very close-up picture of the water um but yeah so just to recap like i said uh we can now get data authenticated data from zano we can have authenticated users create uh data into our database we can edit delete we have all the functionality needed it is up to
you guys now to make this pretty customize it however you'd like and i'll see you all in the next video