BuildShip for Complete Beginners

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
we are live hello and welcome everyone this is the video where we're going to talk about build ship for the complete beginners for you to build so many great experiences for your backend for your flutter flow for your Wei web whatever you're trying to create in no code we have the pleasure to have Shams here Shams how we doing today good good thanks for having me here yeah definitely before we get started could could you tell the good people who you are where you're from and all that good stuff yeah um I'm a co-founder and CTO of Roy build ship so if you know aware already Ro's been for two years now um and mostly focused around a better CMS for fir store so allowing people to edit the data of fir store very easily and basically what happened was we we started building more functionality at around the CMS element where you're able to do function calling based on um data changes and then what we wanted to do is narrow down on like that functionality part of like the back end when some data changes happen or when an an API gets called we want to make that into like a build a logic around that and make that visually easy and intuitive to understand and that's where build chip comes in so build chip is more around doing the functional part of your backend so it's um building an API endpoint to make something on the backend side so you have a secure environment to to run things in and make your API call securely with your private keys or like run um schedul jobs every every day or every hour you want to do something you should do that on a back end they will you can't really do that on a front end right because front end is only based on user interactions and the like the main part is like being able to do all these things with AI um I think it's very important because the the functionality has always been there in terms of writing JavaScript code and running it but the the things that's opening up the space is like being able to generate AI generate noes with AI or like prefill the values with AI so having that as a helping hand is the one of the core pillars of build chip I love it I love it I love it okay so this is great we're seeing people in the chat talking about they want to learn how to use this great to see you Muhammad this is great this is great and you have the best person here as having the co-founder and CTO um that allows you to know about this so this is good um could you talk about this just a little bit more you were saying uh for build chip for uh building different scheduled things in the back end those things could you talk about one or two use cases that you've seen apps that have just like excelled or it's a game changer for for their use case could you give us a couple examples um I think like um like we'll start with like something really simple um let's say you're like using building a flut oflow app and you're making an open AI um call to to the front end right from the front end to open Ai and that like for your demo or for prototyping that works and that's cool but then as soon as you publish it any malicious person can go into your app and look for your API key and go use your credits right so that's something that's like very simple it's just instead of handling that on your front end you do that on the back end side so what happens is that the your flf flow would end up just saying sending the call to Bild chip and then the the request to open AI or your um like service provider gets gets managed by um build chip securely and then the response comes back as whatever if you want to do modifications um it can come back to your like as a as a clean structure dat gotta yeah now let me ask you something um because some people might be finding Ro or build chip for the first time by the way we'll drop all the links down below for you do you use flutter flow and Ry or and build ship or do you just use flutter flow and build ship what do you see a lot of use cases you definitely need um all three um but I think the like for most cases you need all three it's if you're like you start with just flutter flow right and you build out like the basics and then you realize oh I need to manage some data that shows up on my app and then you start using Roy to manage those apps to to manage those data so that's it's like that fire store data that you're storing um that you're accessing on your app so you start using Ro then you start doing the API calls or back in logic that you want to do that you don't want to do on the front end that becomes build chip so it eventually you need all three um I think it depends on what the actual app is um so for example if you want to do just a WhatsApp bot then you don't need flutter flow um things like that so it depends on the the end goal that sounds good okay cool so what we put put in the chat real quick if you want to try out build chip or Roy make sure that you look at the links down below that you'll see all of those things and then what we'll do is again if you have questions all of those things make sure you take a look at the replay don't forget to do hashtag replay down below and we'll also be building out our build ship complete beginners guide right here as we're taking notes and all these things um because um Shams is showing us all of these things and we're I'm taking notes right now for you so can get a uh a link to all the notes as we're talking and everything like that okay so first of all what I'm going to do if you don't mind I'm going to log in or I'm going to sign up for these different accounts so we kind of start from the beginning and we can kind of go through it step by step is that okay with you yeah yeah yeah okay cool okay everybody so remember you can get started for free um and I love free I love free so this is going to be really allowing you to see see what you can be doing for your project and then be able to expand uh if you need to get the paid tiers and all of those things but depends on your use case so we're going to log into build ship and then also rowy in a moment and what we're GNA do should we go through build ship first is that okay yeah um I think so yeah I think um like row is more of like the data part so we wouldn't need that for starting something new so we can just do build ship first and then if we get there we can cover some rly Concepts okay okay so um we're going to be doing this and what I'm going to be doing okay so I am moving some things around I have way too many tabs I have way too many tabs open okay so so when we're starting here should I start a new uh workflow would that be best um you have like let's let's look at the hello world workflow one I think that would that's like the if you had to if you just sign up just get that right and basically what that shows you is that the like the most fundamental part of the workflow in terms of like building an API call is the the me like the request the trigger part which is going to be where am might going to be able to access this and the method which is like what type of API request is it calling um and those are like the rest API method like U standards of how to communicate between clients and servers um so here when we're using like um we want to test out like hey is this is this project actually working um when you press ship um right here yeah so when you press ship it will start building like um the back the the backend configuration to be able to handle those um workflow and basically we have the path which is where is it going to be accessed the method which is um what kind of request you'll be able to handle so by default your browser sends get request so if you copy that URL and then open it in a new tab You' be able to see the the value that's returned so that's going to show you like the hello world value um but for example if we're doing like a post method it wouldn't actually it would it wouldn't work because the browser only makes get requests um so the method is the second option in the in the trigger excellent okay this makes sense this is great so if we want to see it we can be looking at the endpoint URL we can copy it we can see this okay excellent what do what are these three dots over here do if I click that should I mess with this at all or no not really um most of the time you don't need to and we try to like so B I think we what we try to do is um not hide anything away in build because you're trying to build your backand you should have access to um everything you need in terms of like the configuration level and what we like to do is build something that you can open the settings and change everything that you need but by default you shouldn't need to do much in terms of those lower level stuff so but we wouldn't want to limit you to like some decision that I've made or someone else in the team made but you should be able to make more complex choices if you need to get there but by default you don't need to make those changes um we can look at this or like I think what we could do is like add a node in between to make it more interesting okay yeah and then okay let's do it so I would click the plus sign right here correct yeah and then sounds great that that let you pick position where you want to put the nodes in right and potentially like once you have more nodes you want to put something in between and and like the logic of your workflow changes by saying like oh actually I want to add this oh I forgot to add that um here you have like the options are we have like core nodes which are like the logical part of the flow so we have if you look at the core notes you have the return which we already have which returns um the value to the end point we have branching which is like more of a condition depending on what the condition is if it's true or false or like it could be an expression I think that could be something that um we can add now to to test how it works I think that's good okay let's do it okay so yeah so here you have more documentation around it um and then you can click add node um and then that will that will show up here so um by default you have you see in the in the branch node on top it shows you like condition true or false and you can click on either one and that that'll set a static value so it will always be true so then once it's always true it will go to then if it's always false it will go to else but like the interesting part is when you have the pen tool um when you click on the pen tool um okay let's see pen tool this one like the the one in the the one in in the condition next to the condition there we go yeah so so here you can see it's a like it's showing you it's a JavaScript expression um so for example um we could do a condition where if the the request has has a name in it then we can grade the person um with their name if the person doesn't have a name we just say um like all just send a generic hello how does that sound sounds good okay if I'm here that makes sense to me but what if I don't know how to write code you just told me that thing I'm like wait a minute should I go to use chat GPT to write it out and ask for um JavaScript code what what should I do um we can try the AI feature for that um but I think it's because your your your popup is too zoomed in like it's not showing it I think yeah so in that like the wand the magic wand thing not this one the so this one allows you to generate nodes um actually so like if you click on the pen tool back at the pen tool M um there we go so I'm clicking in right here for the magic wand for this section yes and then basically that allows you to say like you can put in your logic here um to like pre-fill it but I think the problem is going to be that like the open AI AP is down at the moment so okay no worries no worries okay yeah so like then you can just say that like Express the logic in English and it'll be able to it'll be able to pregenerate for you um but it's very easy to do like um by by just like coding it so if you clear out that True Value MH and then we can click on variables so here in the variables you have the the request as a variable um if we click on the nested like the like this the sub field the arrow yeah and then we click on query parameters um yeah you can click on query parameter and then we can do like dot name so after the query you can click on it and then you can do name like this so yeah like that so that basically gets extracts that property from the query parameter and by default because this is a condition it will it will cast everything into a true or false so when if we don't specify this parameter by default it will say it's false and then if it's true if it's anything if it's like if you put any name in it it will be true and that I think for us that will be good enough for the condition for the branch right so we can click away and it will save it okay okay I'm paranoid okay it's there yeah so um so that yeah it's that basically like converts that um name into a Boolean so if there is a name it will be true and then it will go to the then section of the workflow if there is no name it will be fced and it will go to the else so real quick just to make sure for the audience if I'm saying this correctly let me know so bullying is almost like if someone imagines an off on switch so they go into a room it's off on trigger like that okay but the the the extra thing is it's like if you in basically if you say nothing it'll be it'll be off and if you say anything it'll be it'll be true so that's the it's yeah you can also say true or false or you can say anything and it will be true by default um sounds great yeah for us that's um that should be enough and then so we could do is in the we can change the you can try dragging the return node on the in you see the top left section of the of top left of the return oh THS I missed you just for a second I think I'll hear you in a second okay are you back yeah okay I I missed that last part you said the top left yeah so the the in the in the workflow not in the node in the workflow um like the under add node button yeah so that one if you click on and drag um drag it into the then like that let's see so inside the then rather than directly the branch yeah there no there is it tricky there there that like that or just above it let me do this like that inside the let's see about this inside the Zen then so if this is right here right yeah I should have the arrow down to put it in not sure would that work yeah yeah there you go so that yeah so that's that's a new feature we're um testing out but basically that allows you to move things around in the workflow and so so now we have like the the value um what we could do is we need to make that value Dynamic um so in the return value the pen tool let's see the so the return value pen tool there we go yeah so here um we can remove the the world uhhuh yeah and then we can insert a variable nice yeah so that one we'll do click on query parameters and then you see here it automatically converts it into like a template string so we don't have to um do anything so then for the the query parameters we're going to do name so it will inside or outside the brackets outside do do name inside right here do name yeah so that that basically is like um template for like a JavaScript template so um it will put your name in that um string um um do you want to add the you can add another return on the else Branch should I add a plus sign right there and then build out from there from return so I'd click the plus sign then I would click return yeah then I would add node yep and I would duplicate the same thing would I make any changes um so we can set like the status code which is like um um like a we can click on them and then you can see the options um let me zoom in let me uh let me see I wonder if this would be better if we can see so I'm clicking in the status code I'm clicking the um the pencil not the pencil the drop down drop down yeah so um we can say it's a bad request because you didn't provide a name okay and then and then you can in the value say like the error message that you want to tell the user to provide the name okay and the value can I just use regular English right here I can just say um ex I'm oh no this was I'm just gonna say bad [Music] name there we go so I have here the value here the status is going to be a bad request here okay and then what should I do so now any changes you make will not go live to like the the the end point unless you press ship so that like that the reason behind that is you don't want to have like while we're making the changes things go live and then it would be like a broken stay in between so every time we want to actually um push something out we can press ship and that will update the the URL that we called earlier and we'll we can try it out again and we'll show the new Behavior okay can I press it yes there we go okay so actually okay so as this is working oh look I didn't even have time to ask my question because it was tooo fast sorry work that yeah make this slower make this slower um so let's let's copy over I'm gonna do it again uh I have it here and then I have oh no bad request or oh no bad name so what we do here is we can put in the query parameter which is like the way we do it with the URL we can put a question mark and name equals sorry yeah so question mark [Music] name equals and then you can put the name that um put should I do capital letters can I have spaces no spaces anything I think anything you can you can do any yeah that that should work yeah let's say let's say Doc there we go there we go yeah so we we just built it right there okay okay so so that basically does like that that introduces like that um kind of introduces the branching also how to deal with templates right so or like writing Expressions um we can try something else as well um okay so I have a real uh real use case for you and this is by the way I did not ask him beforehand this is just people have asked so so this is something okay so someone has asked this actually in the um comment section of a YouTube video just now they're trying to create an app a simple app they live by themselves they're trying to help older ones that don't have anyone around to check on them so they want to create something where they click a button every day and if they click a button nothing happens but if they don't click a button within 24 hours they would have either a message go out to 911 or a message go out to a relative to just say like help I haven't been able to reach my app or something like that is that something we could do in build ship you mentioned repetitive tasks something like that yeah yeah so we could do that so um like the like the idea behind that like you need different components you need the like the API endpoint that we we said so that button can can be built anywhere it could be like a HTML button it could be like a flutter flow button or but basically when you click the button you're going to make a API call um right and that's like what we we're able to build here um and then the next thing is after the a the the AP call is that what is the API going to do and what we would like to do is store it in a database right so we want to store that doc click the button today um or or like yeah so and then and then so we store that on the on the database we might have like a list of users where we can every time the user clicks the button we can update the the time when it was click plus right and then we can set up a a scheduled job every day um where we query the database and say who hasn't clicked in the last 24 hours right um and then you can do based on that query you can do several different actions I love it now again we don't have to do all that right now but the reason I ask you that is and this is great let me know in the comments section down below if you listen to what he's saying do you hear the logic of he's going step by step of what we need to do so if you're thinking about this you need to First write down on a piece of paper or on a notion doc wherever it is write down the actions or write down what you need to accomplish then we can progress and go through these things okay all right looks great um what we some part of it so the next part would be like um like to it to a database right yeah so can click add like add the no so um like if we want to build that one out or you want to do something else we can also do that let's do it okay um you want to make a new workflow yeah sure let's do it and by the way I'm checking open AI is still down but we'll do this this in the intro okay so um I'm going to click new uh I'm going to click the Plus on on on workflow here yeah okay and starting here should I start with adding a trigger what should I do first you should name your workflow so that's a good thing no I'm gonna say um I'm gonna say Life Alert um yeah I'm gonna say Life Alert okay if I can spell life and not live hold on a second it's it's it's a struggle it's a struggle okay okay we've named it that's I'm I'm going it's already GNA be a better day okay all right so next we got to add the trigger so same as last time we I think yeah so you have here you have different um triggers as well so um we have the rest API trigger which we had before which is like like making an API call um we have a Roy trigger that basically if some data changes on Roy um it will make an authenticated uh request to build chip to run some logic so that way like whenever some data changes on on your firestore database either on Ry or on flut of flow that you've made a right to firestore it would automatically call a buildship workflow um and then we have the schedule which is the thing that we're going to use later to like check day on daily basis say every 24 hours who hasn't been who hasn't checked in right um and then we have the others stripe and Telegram and WhatsApp bot so the the WhatsApp and telegram Bots are whenever like let's say we don't do a button and instead we do a WhatsApp bot where that we expect the user to like send us a hey right and we can log that to to the database as that person is still active right so that would be like um another way of doing it but for now we can do like a rest API okay we'll start there and I I like also too like you mentioned depending on a lot of people might think about and correct me if I'm wrong A lot of people are like well I got to do a full app but if you do something with telegram or Whatsapp it might be more applicable to what you're trying to do it might you know more people might join or do things uh with it if you do something like that so yeah I think I think so I think basically you got to think about like what is it that you're trying to solve right um and what's the minimal viable product that you should build to solve that problem um I wouldn't approach anything in terms of like let's build an app for that right it should be like what do we need to do okay let's figure out the easy way to do it and I love it so I should we'll start with rest so I'll do add a trigger right here yeah and then we got by the way C's coming out here he's saying that build chip is an interesting tool no doubt that's exactly right that's why we we have the founders here man this is why we're talking about it it's a game Cher I love it I love it I love it I love it okay so we have this right here we have this right here so um the first thing we're got to do after setting the name of the workflow we got to set the path of the trigger so that helps you scale um once you have like multiple requests you want to name them something that's helpful right so we can call it um daily checkin right or checkin um so right here I should change it from rest API to Da or just keep it there so that that stays there but the path can needs to be updated so daily checkin yeah check in okay and then and then and then we can just um just to make sure it's working we can add a return node and say like thanks for checking in return so I'm going to click the plus sign I click the core for return click add node and then and we can set the status to okay and the value should be like thanks for checking in here we go okay and then so what we could do is we can we can add a note in between uhhuh [Music] and basically yeah we can do the we can search for fir store [Music] um okay or do we have if you yeah so if we click on the so we have two options here um we have fir store as a option and then build chip database as an option if you see in the Integrations sections on the on the left so the difference is um every pchip project is actually underneath is a Google Cloud project and and that has all the services that you can have in a in a Google Cloud project that includes all the Firebase all the Firebase features like Au and um fire store and storage and the thing with that is that if you already have a Flor oflow app that's connected to your own project and you want to use that fir store then you use the fir store integration and it allows you to specify your project IDE and then that like easily links up to that to your project database but if you're new and you don't have a um if you don't have a database then you can just use the bill ship database okay and so if I'm hearing this correctly um if I wanted to going forward if I wanted to do a brand new flutter Flow app and use the database already set up I can just use a build ship database and I don't have to worry about configuring for or um in fir store and everything like that am I understanding that correctly well so if you're not doing fire store directly with flutter flow so unless you want to get flutter flow to use Bill ship databases that that could potentially happen just need to ask fler to do it um but if you're just using a database directly on build ship then you can just use the build ship database so all if all the interactions are done through build chip then you don't need a fir store your own fir store setup I love that I'm gonna do that okay we can click here and then we can find the do we have a what options do we have here so we have do we have a uh add object get document um do I have a create document let's see create document yep we have one yeah use that yeah and basically um we can set the collection name so the way like if we want to map it out what I'm thinking is we have a collection of users so we can set the collection name to users um in the like the first one is the collection name if you H yeah yeah that's that's that one and then the document ID I'm thinking we can pass that in as a query parameter so that will be like the user ID so same way we pass the name we can pass in the user ID okay am I understanding correctly let me zoom out for a second would I be clicking the document ID I would click the um the edit right here on the side and then go to variables yes and then go to requests and then from there I would do what so so I think for like for Simplicity sake we can do the same as the name um okay which is the selecting the query let me do this let me do this back here so user so collection name is users here I'm going to just do document ID having the value as users right here am I understanding that correctly the document ID is going to be the the the the the user ID that we're going to pass in the query parameter query parameter the query parameters were in the variable section correct it's yes so request yes there we go so that's the that gives you the whole request object but you can navigate to the and then you can here you can do doc query but you can also it will be easier to you can clear that one out and select the query directly let me do that okay request here yeah and then you have the query parameters and then here we can do dot U ID or user ID user U ID okay okay this looks good okay and then what do we have um so if we click away now we need to put some data in um so in the data object we'll do we'll set the the current date okay so I'd go to data right here and then from there I would go to edit here and then from here where would I go would I go back into another or typing what would you think right here um so I think what we need is like um checkin time right so the data is going to be the the fir store document um so we're going to need to return object which is going to be the the fir store document and so we can do like the like a Json um C bracket M um and then we can say like checkin time okay and then and then we do like um what is it is it semicolon or the the colon yeah then yeah that one and then we'll do a JavaScript date so JavaScript date is like new you write new and then date um but with a space and a capital D capital N too or no like that there we go and then it's a function so you need to um Circle bracket Circle bracket around the new date no after the date so after date um no after like would it be similar to am I looking at it like this would I do that no no so the way you think about it is um date is a like a JavaScript function so and when you're calling a function so by by just writing day you're doing a referencing to that function to that variable but when you do a c a circle bracket um after the the the reference you're calling it there there you go and then some functions taking inputs and then you put the inputs inside the the circle right should yeah should I put anything okay okay because we're we're just going to do like um we're just going to get that will give you just now right so if you want it has a lot of different properties and you can like Google JavaScript date and that give you a lot of all the documentations you need to know on how to use this so um by like by Bill ship not introducing its own programming language and just using JavaScript you get a lot more documentation online for you to learn on how to do different things as well as AI will be a lot better at like um being able to given that it's trained on all the JavaScript stuff out in the wild they will be able to generate better um like um Auto Fields love it okay and this is good now by the way because listen I'm bad at JavaScript as people can see live uh sh is there any reference you're saying look at the documentation I like how you mentioned with the function now of course when AI you could be saying it in English you know um uh CER English and will be able to do it but is there any reference or anything that I should be looking up or kind of being more familiar for me to be more proficient anything you're thinking yeah so I think like um basically searching for like um JavaScript date function so that give you all the there there's plenty of documentation around that so we're not like inventing um an unnecessary thing that like you have to we have to a document ourself and then for everyone to learn it um from scratch so if you're already familiar with JavaScript then it'll be very easy to pick this up if you if you're not then there's plenty of like now it's been like is it 20 20 30 years of JavaScript yeah um yeah just about yeah I think that's good enough I think that's good enough okay good okay well that's great that makes sense so we have the structure there okay yeah we've got that set up what should we do next um so basically now so if you click away that will save it and we can look at the last property and that basically is um the last property is the merge so and that basically it's a fir property so if we set it to true it will add that data that we have to the existing doc to the existing document if we set it to false it will delete the existing document and and set the whole document to be just the checking day so for example I would imagine in our full app we would have other user data like their name and their email and address and other stuff so we want to set the merge to tr so every time they check in we don't delete their data we just add that checking time stamp right so but sometimes you need to reset the document and that's when you use the false so wouldn't merge um yeah so um yeah I think I think that's that's it in terms of like um being able to like add that check-in date um so we can ship it [Music] and I think the missing piece is like we don't have any like user user data on on that right like tracking their their name in email or just the basics of any login information is that correct um yeah so like there like we didn't we we probably need like a sign up um path yeah so like somewhere where we can say like um the user ID is is this and this is the their name email and address um do we want to do that in flutter flow is that is that possible so we can show that I think so let's uh so let me make sure I understand you want to set up in in flutter flow the collection of the user ID uh the name the email address all those things in flutter flow is that correct no no no we don't need to do that we just need to like um have like a form that users can can put in those things and then a as a as a post request um I think we can do that yeah I don't see that being a problem I don't see that being a problem um and also too there is uh let's we're going to go over there to flutter flow in a minute I think about also um almost personal use first if someone was going to use it just for themselves right um maybe they won't need will they need more information with the user and everything if they're just using it for themselves I wonder uh um no then like it would it wouldn't if it's just one person um then then we don't need to do that so I would say if possible I would probably and this is this is just me we can definitely do it to show how to add the users the the person was saying it and like you were saying the MVP if this is personal use and scratching their own itch it would be very basic and just Theirs to fire right then if they're having other people using that then they would be adding on to their process and everything like that would that be easier to add other things later on in in build chip or do you feel like okay so you could expand if you wanted to later on yeah so so like for example if we say like you're like if the person only wants to do it for one person then we don't need that complexity of a sign up right so we could just do the the like we can do the check in now and then we can do the like the Chrome schedule instead okay let's do that so we can make the call to like we can ship that URL and like the end point and and basically did I already do it let me do it again there you go and then basically like we'll we'll copy it and we can pass in the uid nice okay test it out right now test it real quick or no so we'll pass in a query parameter um I think if you already called it okay cool okay so I'm back here and if I'm understanding correctly are we going to add one more node um no were you able to call it um I think okay well we need to pass in a uid I think because otherwise it will it wouldn't really do much okay so if you remember the document ID was the the query parameter had the uid in it SOC parameter and let me go over here this one m so we need to pass that in um in the request okay I think otherwise it will just set it to undefined or something so in that in that request um in that URL that we called earlier um we need to pass in the question mark uid equals to and then something got it like value so and let's see should I do a almost like a date and time to have it as I'm doing this so it would be question mark and then I would do the exact let me write it down right here I would have should I have the date adding a new date if I'm doing it if I'm doing the request here like would it be a structure or no no no no because where like that's what like the how we can simplify our front end is but by adding that logic of the date inside on Bill chip we're simplifying the the request we're making from the frontend right and that a that gives you two benefits like not having to do the logic of finding out the date on the front end and also trusting that the user is sending in the right date right because that could be either a mistake or even a malicious um actor trying to set an old date to trigger the system to have a false um positive right so it would so we don't let the front end say set the deck the front end can only make the call um to say I'm checking in and then the back end decides like yeah you're checking in right now okay so if I'm understanding correctly if I can I start building can I go to flutter flow and start building the button in in starting there is that okay we can do that too yeah so so we can do that if we want to like if we want to do that we can do that now um that would that would work as well instead of the URL instead of calling the let's um well I don't wna I don't want to mess it up if you're like okay we we can finish up here first okay okay so the next part is like we need to make the so if you go to the back to that URL um the one we just shipped so the yes um and then the the thing we need to pass is the uid so that's going to be uid um equals and then you can set anything should it be um how should I um structure the the time should it be a is it that's that's not the time that's just the user identifier right so that could just be there you go the person yeah so it could be the person it could be like if you're if you already signed up with like Firebase O then usually Firebase o has a has a ID then you can use that that makes sense that makes sense well thank you okay so I have this yes okay so so so now that did you call it I don't know um yeah there you go that's all so now that you have it then we can start building the the scheduled um job right so that that daily system check who hasn't checked in the past 24 hours right just yes I'm just writing it down so I have it okay that sounds good okay so um it looks like you um you run out of the you've you've already used all five workflows what do you have in the Untitled workflow if we don't I'm just clicking things I can just delete it you can also upgrade you see how this is did you see that it was a simple simple gesture I will upgrade later I promise I will see now I feel terrible now I feel terrible now people are like oh doc he's doing this and he's such a cheap skate he won't even get onto the paid plan okay look now after it's going to work then you you're gonna you're gonna like it then it's it'll be worth it for you but if you only using it for your personal use and you don't need to scale like all the features that you have then like if that's the only workflow you're going to need then that's fine and that's we don't want to have we don't have to charge for that but once you start like having millions of users checking in we should yeah I definitely I definitely need to this is this is going to be good this is going to be good okay so back here I should do a new workflow now I should do another one yeah okay okay I'm going to title it first this time what should i title this one what will this be um so we can call it like a scheduled checkup right so that's GNA be the scheduled check up okay so I'll have it again I'll keep it together with uh life but I'm saying Life Alert scheduled checkup okay next I should add a trigger yeah there you go yeah and should I go to schedule Instead This Time y okay so I have schedule right here I should say add a trigger and we're doing this because now we're doing the scheduled section here okay I see it yeah so um I think so basically we have the the schedule um which is what we can set um I think if you click on the so basically that's a a chrome format which is like a technical way of specifying when to run a function um but I think if thei works now again we can try it to auto fill automatically so we can say every day so if you click on the pen and then on the on the AI prompt see if that one works we can try that this right here yeah and then to say to run every day so run every day that's [Music] it oh no it didn't do it um can we clear that one out yeah and then and then let's try let's try um let's try doing it can if we um let's try doing again um and then we say like uh to a crone that runs every day it didn't one work if it doesn't work we can do it the oldfashioned way we'll see we'll see thinking about life this is good Okay click out and come back no no no we'll just wait for it just give it a second worries I think also because of the open AI API is currently unstable um ah so that potentially like causing it um well Google still works so we can Google how chrones work okay let's see what should I say okay um so like maybe like how to like a Chron for every day or maybe this SC if you scroll down there might be like a Chron calculator if we search for a run calculator or um yeah yeah that the first one should be a good resource every minute um day the month maybe day of the week um let's see oh so we could do like every um so the so the second star so the first star is for the minutes right um so we can remove that and then we can do the second star we can make it every first hour of the day so it will be like star and then one so you can remove the sl5 and put one can try it yeah so no you need to put a space in I think space one space one yeah okay every second every second that one minute so I think it needs to the first one needs to be zero rather than um no so it will be every 0 second so it'll be like a zero space one let's see okay zero space one yeah um and then the the so one Z for the second one zero for the minute and one for the hour so the the first star should be a zero the first star right here on this side should be a zero yeah is that correct um so yeah so now that's that's that's that makes sense right oh no that's every hour so we need to do another zero so zero space space zero or do or what am I am I going crazy no no you're nearly there um but we need a space for the there we go like that I think so see did another space we need to remove the star this one over here this one okay yeah there so now it's it's at 1:00 a.m. and you can change the one to like 2 am. or whatever makes sense you could do like 12 let's just do seven seven sounds good yeah that's okay so so now what we're saying is um every at 70 so if you look down at the like that table underneath that hopefully makes more sense now um of where weying each thing and then maybe like we do it um on weekly or like different things so then we can play around with it oh okay okay so um that's basically um how we can structure when we want to call when we want to run that function so instead of being called by a by a front end it's going to be called by a system every um so we can copy that one over copy it [Music] yep and then and then we we need to change the what happens if we click away do we need to refresh it's yeah so we can paste that value in directly there there you go and we can keep the time zone and the location that should be that shouldn't be a problem um um so next we want to do like a fire store query or like a bill ship database query right so wey the the so we want to search for fir store and then click on the the bill ship database part so that that's the the one that we're hosting um and then we want to do a collection query okay so um basically here we're going to have the The Collection name which is users and we can set the filter but for now let's let's check if it's working um in terms of like if we get any data back um so if you click on that um that icon next to the dot dot dot on the collection query the the the code icon yep that one so this here it shows you the it allows you it's like a playground for that note so you can you can make any changes um you want in the like on the on the right hand side so if you want to change the logic for the code here you can um but we're here to like test that if that node is working so if you run that test node button um right here yeah so um we need to so you need to set a number of the limit um and then you can say like a thousand or like a not here in the in the node the node right here yeah should I do a so that like helps um in different ways setting a limit to the query so you want to make sure that you're not over querying um for multiple reasons like for cost so every time you make a you make a query it will cost you um per document in The Returned result um so that one opt one reason could be cost in terms of trying to optimize another reason would be like um let's say you have like a million users and you have a bottleneck somewhere down the line either like Bill chip can't send out a billion emails at the same time or even like the this the email provider can't send out a million emails at the the same time so you can do like a group in terms of um setting a limit in terms of how many results you get back and then maybe you can do like another schedule like instead of um our system where it's checking every day it can check every hour or every like 10 minutes if we haven't seen someone for the like the past 24 hours and then it will send that notification immediately right so so that would that would like distribute your load over over more like smaller chunks and that helps with like having like reducing like getting stuck with bottlenecks in terms of any system that you're building or using um like trying to chunk things down into smaller sets it will help a lot easier but for now you can just run test and then we should be able to see the document we we we created earlier so if you run test should I save it first and just do this and then so saving is only for like when you're making changes to the to the node code or the inputs and outputs and you want to use that in the workflow that's when you save but here we're just playing around with a node without having to call a workflow so we can just and that basically in the in the background builds the builds the function only for that Noe versus like the workflow builds um the whole workflow so if you click on the green play thing so here we see um the data that we got so um we have the ID which is um online 21 you can see that's like the the document ID which is Doc um which is the user that we that checked in and then see on like the line 13 is the data of that document which is the check-in time and that could potentially have been the the user data as well can go there but here so you can see um we did a query on on that collection and we got all the users back so that's like the um the users that we have there um we also have other users I don't know where they came in from but potentially someone else tried to call this API and yeah yeah so we have like three two other um experimental people get them out of here that's fine that's so yeah so like you see here it's like those two data those two additional users and then we have user um and then what we would want to do is like we would want to filter um by the checkin time [Music] um or yeah I think we should order by the checking time first let's try the order by um okay right here click in or go to edit um just click on the editor and then we can see [Music] um let me see um if we click on if you click on inputs um in the in the top right top right okay yep yeah so if you click on order buy um and we can look at the description so so here you can see in the in the description um if we were outside in the workflow we would see that outside but here we can see um how to how to use that um order by field so um some things are like we try to like document in terms of how each field is used especially if it it's a bit like um specific and in this case the way that we set the order by field is by specifying the the field name and then the direction which we want to sort so we want to order by the the checkin field and then the the direction is going to be ascending or descending we want to get the we want to get the last we want to get the ascending ones okay right because that the last the the least recent checkin would be the the lowest value that makes sense to me that makes sense to me yeah so I would copy this whole yeah so you can copy it without the quote um yeah that one yeah and then we can paste it in into the editor just right here yeah um yeah and then we want to set the the field name to be checkin time and the field name I would do it right after the colon oh no no the field name is the the thing we're going to replace yeah check in time yeah um no that will be the same way we stored it in the so if we click on that green button again um it should help us um did that go oh no it's gone we have to run it again why no worries we click that one so we need to we need to make sure that we're using the same schema like the variable names so I'm just writing down just put this here okay we click the green button yeah so you see here the on like on line five we have the checking time um all in lowercase so that's um so and then we bring it over if I'm going to have it in field name I would just replace it so i' take the checkin time copy it and then I would put it directly where the field name would be paste that bring this over come back [Music] in and then I would have it here yeah okay yeah and then we can run the test again to see if the if the Sorting put you yeah um okay so if we look at the um so we can see here is it ascending or not so it is ascending uh if we scroll up to the top is that lower is the first one lower second that would be lower yeah the first one would be lower this would be we're looking in the seconds right so this would be MH yeah so this would be the lowest yeah okay um okay I think the next part is how do we filter um how do we filter by by the value right so we need to look at how filtering works so so now that we're like sorting that data so it's going to be easier to filter where it like it'll crop the the the parts that don't um that don't fit in um and the way it works here it's like um three properties um filters they have the field the operator in terms of like equals or less than um or and the value and we can look at like the fire store documentation for this um I think that would be helpful so if we look at the fir store documentation on how to how to filter by a date um then we can we can get a hint for how to do this all right should I go for the official one or going to stack Overflow what do you think [Music] um well both of these are more reliable than open AI so we can I'm taking both right now let's see I always find when I'm in Google Cloud it just feels like the documentation feels overwhelming when I go into like Google maybe that's just me maybe that's just me yeah I guess because it's so it has a certain structure so once you get used to it it will become more like know where to put your eyes on I guess so yeah but like it is more up to dat so for uh for Google for like for yeah for us to like to look at the Google documentations um it's it's more up to date um do they have a a date filter let's see about this on this page let's see simple ques do I see anything with date let me see we make make it easier for ourself um um so what we could do is instead of storing a date in in fire store um when the user checks in we can store a time stamp okay and that that would just be filtering for a number right so you can click save here um to go back to the workflow and then we can um try to update like um if we go back to the the Life Alert um workflow and we go to data and um we can we can Google how to get a time stamp from in JavaScript I think it's how to get a timestamp in JavaScript let's see about this all right let's see create a new date object and use the get time yeah method so so um so that means all we have to do is after if we go back to um the data um the editor the new date thing that we had M and after the the circle brackets we can do dot get time let me go back dot get time do I have to do it with the the capital T yeah MH yeah yeah that's and then it's also a function so it needs to be um uh need to yeah and I think we need to put the whole new date into Circle brackets as well um but I'm not sure because that's like that's its own object so can so we can put the circle brackets around new date the whole um like that yeah and then after the there we go yeah okay um and then and then I think what I want to do is I want to change the variable name the the variable the property name here so that it doesn't confuse us with the the old time stamp that we were doing so we can change like the checking time to be a capital I um or like a capital T capital T here mhm yeah okay um and then yeah so then if we ship it again um and do another check in um so if we go back to the same URL um I think we don't have to copy it each time because it's the same um the one we set so if we go back I think you have that page open um and then if you call it again um yeah so that's it so if we go back to now we go back to our old um life alot schedule one we can go back to like try to check if our data got updated so if we go back to opening that node and then I went there by first going here correct yes there we go and then testing the node here yeah going to run it and then see what it looks like okay when the green button appears yeah so that that runs that function and then so if we scroll down to find the doc do the see now you have the checkin time with the small T which is a nice and then we have the checkin time with the Capital C which is going to be like a lot easier to handle in terms of setting up a filter for nice okay and and I think that's like generally when you're trying to like solve a problem is not always having to like solve in a certain way and sometimes you like get stuck and you're like how do I filter through a DAT and it's possible Right like we can filter a day but then it will be a lot harder and we can do the same exact thing with that makes sense yeah making making things easier for ourselves and then just looking at different ways of solving the same problem um so now for the filter it's going to be very easy it's going to be um the less than um property so we're going to do let's open the editor um okay want want to copy the you want to do on notion as well so we can we can map it out on notion might be easier yeah so we want to copy those um the the instructions we had on on the build chip um so in the inputs and putut hold on yep um we have the filters we can copy that object filter the field operator um value object just uh yeah just field value just this section or copy the whole thing copy the you can we can copy the whole thing that's fine okay there we go it um yeah so so if we construct so now we need to construct an object um so what it's saying here is that bill chip that node takes in an array of that object so similar to how in the checkin time sorting thing that we did earlier um what we do is we start with a square bracket and that indicates that we're doing an array um right so it's going to be an array of filters and the filter that we're going to look for is going to be so that's the that's going to be an object so that's going to be the um a bracket so it's going to be an array which is a square bracket and the first object is going to be um identified with the with a curly okay so if I'm understanding this correctly I could be wrong it would start like this or let me zoom in hold on one second do that you're saying it would be like that so first starting out here and then going in curly brackets correct am I understanding that correctly the cly bracket needs to be inside the array object so so the the yeah there and then yeah there you go and then here we can add multiple filters right so each filter is is a curly um but for now one filter so our filter is going to be field um and then the field is going to be uh like we need to set the name of the field so the then it's going to be a colon and then it's going to be um the field name which is checkin time but that's going to be a string so we need to do the quotes gotcha um okay um so we need the capital T because we we changed it right um and then um yeah I think maybe we'll do it in build Chip it'll be better um I think that's going to but basically we'll do the the resting build sh will be better um because I realized the quotes might be a problem when you're if you click on the filter now uh editor yeah um oh so it's already done for you actually so we can just type in we can just type in um the the operator um the operator is going to be less than no no no no will um we'll keep operator and then in the in the empty quotes that we have there ah um no no no we keep the we'll keep the colon to to to like set that property right got it and then if we go back to the the we go back to the Google the fir store documentation um I think we can I can show you that one um so you have this um operators you have the less than equal um equal to so we want to do is we want to query the documents that have a time stamp that's less than um 24 hours ago right so that's what we're gonna use the less than operator and I would do this like that pretty much no it's in it'll be inside the quot oh okay so I don't even have to so I can just do the less than like that inside the the quotes for gotcha y yeah and then so the field we should set the field name again so that one is the last in this object uh um we said the similar in like the check-in time checkin time got it is the not not here um in the you see you see the the field text property and then after no we'll keep it we'll keep and then and then we'll add it in the in the quot so similar to the operator got it yeah Sam thank you for your patience I know you're going to be drinking after this session but I I appreciate you oh good um so I think the last bit we're nearly there um the last bit is the value so the value is not going to be a string the value is going to be a number and we're going to do like a calculation here so um we can remove the quotes right here these yeah yeah so those quotes can go because these are specifying a string and what we'll need to do is we were going to do the time stamp of 24 hours ago so the first thing we're going to do is we're going to do we're going to make a new time stamp so it's going to be the same as what we did before which is going to be new date and then get time where did I have that before Oh keep going yes yes that one so that one we can just do it I think think it's in the in the other part of the workflow but we can we can we can just write it again so that's going to be like Circle brackets um and then new date um if yeah inside the yeah inside the circle like that one yeah because we're gonna yeah we're going to reference that property um no no the space after the you yeah and then that's like um so we need to do a circle bracket after the date to to initiate that date and then after the the second Circle um we're going to do do get time and any capitals do we need to do it or can it be all T capital T for the time okay um and then we're going to do we're going to do the the it's a function so it'll get the circle brackets again after get time y so if we run this now if you click away and run test test um test node so that should give us all the like that doc document I think if we if we click on yeah so that see that only gives us the doc document because that's the only one that has the checking time property so basically our filter is like which whoever checked in before now give me that document but we want to do actually is like whoever checked in um before yesterday so so now we need to do more math so we're going to do that get time um we can do like minus after that no afterwards before the after these brackets or before before after yeah and then we can do minus and then we'll do we'll try to do it a whole day right so a whole day is like how many seconds how many seconds is one day hold on one second we can do like um we can just do like six * 60 * 24 directly oh you want me to just do that yeah yeah we could do that you said just 60 times 60 yeah star switching over and then I think it's because the time stamp is in milliseconds so we'll do times a th times a thousand yeah because milliseconds so so if we click away now and run the test again it should give us no results um yeah see so so like um what we'll do now is we'll copy the filter over um so if if you open the editor for the filter because um if we copy it over to the in the clipboard because here we're in the node editor we like this is more of like a a like a sample box environment um we go back to the workflow so if you click save or cancel because we didn't change anything um just can okay yeah um we can set the filter so that we need to set the filter here now because that's where we're going to use it so so we can paste that in the whole thing the new one okay okay so yeah so basically instead of having to like run the workflow or figure out how we're going to run this CHR every time we want to test it we can just open the node directly and be like playing around with different values and experimenting and learning how to use different nodes and then once we figured out how to use a node if it's working if we need to make changes to it then we can go back to the workflow level and and do those um changes there so now um what will happen is we'll um the the the firar collection will query will return an array of of documents so what we'll need to do is like we'll need to Loop through the array of documents so if you click on add a note after after the collection query you can click on Loop the the core node um and what looping allows you to do is go through a list of items so um you can see like the description here and by default you can like in the editor add an array of items but if you add it we can we can show you how we can use it dynamically okay so in the items we're going to need to Loop through the The Collection the the results from the document so um we can click on the pen tool and then variables um and then yeah so inside that the collection query um we want to Loop through the we can we can Loop through the collection query which is an array of like document ID or we can Loop through the doc the the data directly um and what that will do is everything that we're doing inside the loop will get called with that data um so this would this would help us if we have like like we said if we have a lot of users that need to be um like for example if we had a user for this use case um if the user document had like who should I call like should I contact um a caretaker or someone that that needs to check up on that person that hasn't checked in right so then you can do inside the loop you can do like a another fir store query or another API call or something to like access external data to like okay I'm going to get someone's email and from that I'm gonna send an email to them to notify them someone hasn't um checked in today right that makes sense and that would be the document data to be able to grab all that information to go deeper yeah so we can click on that document data um and then we need to remove this Square I think the square brackets shouldn't only for yeah so we can remove that square bracket um and then if we click away um that's where we're going to where it says add node um this one that's where we're going to do the individual level logic of that um what do we want to do when a result comes back with someone that hasn't checked in right so we can if you click on ADD node um I think we can just so if you scroll down I think in the Integrations what do we have um do we have so we have like different things like Discord or send Grid or resend or slack or Telegram where we can or twio so like you can use twio to send an SMS um or you can use send gr to send an email right so um so we can like let's look at the twio one for example I think does it have a uh yeah so we have the SMS sender um so um like let's add that in and then we can um so so this one like it'll need some setup so I won't go into it today um but basically you you would have to set up like a a an account with a with like a third party sender provider and like twio would be one option and here you can just specify like twio will give you like the authentication token that would authorize someone to like Bill chip to make SMS message is on your behalf and you would pass in the O token which is your API key and then you can send like for for twia there's like a there's a from number and a two number and the messagebody will say hey this person didn't um check in today right um and that that would that would do so I think that would like finish that whole um yeah project so I love it hope that was fun no this is good no this I think it and the reason that we bring it up so thank you very much um and then also too it we we we do not because we already went over time so thank you for your time um is for the integrating it into flutter flow is on the build ship YouTube channel is there a video step byep how to do it we we can always do it next time or just reference the video um um I don't think we have it yet but we'll probably have it soon so like build chip is very new um we only released it like like a little bit over a month ago so there's a lot of updates coming out um weekly and like more videos so if you go to like the um the build ship YouTube channel there's a lot of videos um around documenting how to use build ship and then I I think soon we'll have a video on how to use it with with flutter flow we can also do like another live stream um yeah to to go through some more examples and how to how to use this example or another example in a PL app that would also work okay then we'll do that again this is uh thank you for your time please don't go anywhere when we end it I just had to say goodby but but no this we dropped the links down below to make sure you check out subscribe to their Channel just passed 2000 they're growing so make sure that you check them out all the new videos that they're adding all the different things from there um the other thing is to keep in mind as you're going through this um and this is why we're having examples this is why we're having this conversation um with with build ship and with the team you have to make sure that you're writing down or writing out the process what you're looking for but also it helps so much if you already have a um if you have looked at document before or have a basis to be able to structure this as you can tell me I do not so that's why it takes longer but the more you practice the better that you're going to become and then also too um just like we were talking about before and we see it in the chat uh open AI was down for a lot of the time so working with using um plain English and creating that we'll talk about that as well uh with using build ship and everything in the future um so again um SE thanks so much for taking the time and for being here and uh and just gritting your teeth but passing and making sure that I made it through so thanks so much for for making it happen man thanks no it was it was fun I think like yeah we can do we can still do it with the AI stuff so yeah I love it so remember in the chat down below let us know if you're watching replay make sure you like And subscribe for the build ship YouTube channel for this one if you like it and make sure that every single week we do this we bring you great documentation or we bring great videos to talk about documentation what you can be doing and we'll be seeing you in the next video remember ask all of your questions down below and we'll see you in the next video
Info
Channel: Doc Williams
Views: 6,969
Rating: undefined out of 5
Keywords:
Id: S1XO4wsZJMA
Channel Id: undefined
Length: 100min 11sec (6011 seconds)
Published: Thu Nov 09 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.