Python-powered chat apps with Twilio and SendGrid Transcripts
Chapter: Messaging and workflows with Twilio Studio
Lecture: Using Liquid in the flow
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
If we look at our interaction,
0:02
it was very vague. We said,
0:05
Come over here and ask. You want a small,
0:08
medium or large size and we check if that's good We say,
0:11
Great, you've made the right choice and if the wrong you've made the wrong choice,
0:14
it would be much better if we could be specific.
0:19
And now that we know about Liquid,
0:21
we can. So if we come over here,
0:24
we can see where it says Great.
0:25
That's a good size. The send and wait for reply element that has got the
0:29
data and it is called welcome.
0:31
So what we can actually do instead of say that?
0:35
Well, say something. Concrete is a good size.
0:37
So we say double curly ( {{ ) notice our auto complete is coming up here.
0:42
I get it to show on the screen with somewhat small resolution.
0:46
And we could say widgets, welcome inbound.
0:52
And as you type, you can see it narrows down.
0:54
So inbound body like this is a good size,
0:59
and this is the same thing we're going to want over here as well.
1:02
So let's live settle. So this one has a good response,
1:06
and we could say sorry such and such isn't a valid response a valid choice.
1:15
So let's go ahead and republish those changes or publish the new changes and try again
1:21
All right, let's kick off another flow.
1:25
So is it cake time? Yes.
1:31
Greetings from Cloud City Cake Company.
1:32
What size of cake would you like cake time?
1:34
I want a huge cake. Sorry.
1:38
Huge, isn't a valid choice. All right,
1:40
fine. I'll tone it down.
1:41
We'll have a small, great small is a good size.
1:45
Now, of course, we need to ask them other information like,
1:49
Well, now, what flavor do you want to want?
1:51
Chocolate, Vanilla, carrot cake kind of frosting.
1:55
You want toppings on it? Like Sprinkles.
1:57
We're going to have a lot more of this interaction.
1:59
But you can see already that we've got this really cool workflow and validation,
2:03
and we're using the liquid template language to actually grab data from one part and use it concretely as we interact with the subsequent part of our workflows.