Zapier Paths and ChatGPT: Creating If-Else Statements For Emails | Tutorial β
Let's build with Zapier and AI (100+ videos)π
2023-05-20
Transcript β
[00:00] welcome back to web Cafe AI where we do daily chat gbt and AI videos on how to leverage it for your personal and business life and today's tutorial is going to be more of a complex one but I assure you by the end of it you're going to learn a bunch of stuff we're gonna figure out how to build out a zap that basically sets up if else statements and we're going to use GPT as a way to identify which path it goes down now if you're familiar with coding then you're very familiar with FL statements and that is what we're going to be creating in today's zapier essentially the idea of what I want to do today is I want to have an email come in and I want gbt to
[00:31] read the sediment and depending on if it's negative or positive we do two separate things we're gonna go ahead and rename this to if else flow and we're going to go ahead and use uh zapier's path function to start off we're going to say Gmail as that is going to be the trigger for this context obviously use whatever trigger you want to do in your context as you're about to learn how to do an if else statement so for us we're going to say uh new email and we're going to hit continue and then we're going to choose our sandbox
[01:02] courses account email we're gonna get hit continue again then we don't necessarily have to put a specific thing in here we're just going to say inbox as we've already sent over a test email we're gonna go ahead and test this so here is the email let's go ahead and check it out on the Gmail side all right so we went ahead and just sent over a mock email for today's tutorial essentially we have the subject line as review for services or view on services and it says Dear webcap AI Solutions I hope this email finds you well I'm ready to convey my utmost satisfaction and
[01:33] appreciation for your remarkable services and solutions offered by web Cafe AI Solutions so the context here essentially is that this is obviously a positive email and we're going to build up this flow in order to identify that and then we'll have specific tests or specific steps to take after we know it's positive that will ensure the best way of operating all right so now that we have the email done we can go ahead and continue here and we're going to add the paths from zapier and essentially we're going to do two paths obviously as you can see here you have a Max of five paths but that gets
[02:05] more complex flows but for us we're just gonna have an a path a and path B we're going to go ahead and rename these two positive and then we'll go ahead and rename the other one to negative all right so we have our two paths here but we need to add one other block here in the middle and that is going to be chat gbt as this is going to be our sentiment analysis of the underlying email we just got so we're gonna do Chad gbt we're gonna do conversation all right so now all we need to do essentially is we can go ahead and just give more context to gbt so we're going
[02:36] to say subject of email semicolon parentheses and then we can go ahead and find the subject real quick we can use this little search thing here and come up here to subject I'm going to do parenthesis again to make sure the data is condensed we're going to say body of email semicolon parentheses and then let's go get the body of this email and we can just do body plane unless there is some other context here body plane looks fine we're going to do parentheses again and then we're going to give context here so we're going to
[03:06] say context we need to identify whether the email is positive or negative and then we're gonna go ahead and make sure we solve this correctly this is so we know where to place it for our agency we're gonna do parameters here and we're gonna do something longer to say generate just uh quotation marks positive
[03:40] quotation marks or negative your rotation works here negative and then from here we're going to go ahead and upper model to gbt4 as this is going to be a little bit more complex for to really understand cinnamon analysis obviously 3.5 can do this but I like going before with more pertinent tasks from here we can go ahead and add a memory key to out all right we're just sent out and then that's just to ensure that the way it formats the output every single
[04:11] time is consistent as you know the memory key in this context is like using chat gbt chat but it's UI over there so let's go ahead and see if it understands it all right perfect so it does understand it just put out positive and then I'm assuming just for the sake of testing it let's go ahead and say we went ahead and removed the variable from the email we just said bad service and then I will never use your services again let's go ahead and see if gbt is able to interpret that sentiment analysis and we should be
[04:42] getting an output here of negative all right so as you hear we got our output of negative really good stuff so now we have created essentially the thing that's going to identify what path it goes down so I'm gonna go ahead and real quickly put in the variables we just had here which were which was subject and then just plain body for here body body plane all right so now that we have created our sentiment analysis toolbox here we're going to go ahead and jump to our pass function in order to ensure what we do depending on the type
[05:13] of feedback we get for our services so for here since we have positive as this one we're going to say only continue if chat gbt assistant response message exactly matches because of the fact that we have formatted it with the memory key we can be rest assured that it will either be positive or negative there isn't going to be like this was a positive email no it's just going to be positive or negative we have identified that and then from now we should hit continue and this should execute and this should say green light perfect it does from here we're going to go ahead and back out of this path we're
[05:45] going to jump over to this path real quick and we're going to do the same thing so we're going to say only continue if system props message exactly matches negative and this one should be red light and it should not continue because the fact that it is not negative it is positive perfect all right from here all you would need to do essentially is you can set up uh flows depending on the context of what you want to do so when you receive a positive email okay great send it to the slack Channel send it to XYZ send as a text message to yourself send it to an email to this individual you
[06:17] can receive a email that is negative or not good looking you can now use the negative path as a way to like maybe float out to a different sector of your business or or function of your business so just as an example you have a positive email maybe in that context you want to send another email to a specific individual I would typically use the Gmail block here and build out a Gmail block obviously this can get a lot more complex of how we want to approach the different paths depending on the context we're dealing with here as always I want to make sure to put this zap in the description below so you can go ahead and click that right away if you enjoy
[06:48] this kind of content make sure to like the video it's completely free and it really helps us hear web Cafe AI also if you're a long time viewer or a new subscriber of this channel make sure to let me know in the comments what other kind of AI automations you're interested in specifically what kind of apps are you interested in and learning how to leverage but without further Ado I'll see you in the next video thanks for tuning in and yes surprise I'm an AI Avatar make sure to explore more here at web Cafe where we demystify AI for your personal and business life
[07:20] until next time