Skip to main content

Section 4: Start Working With Logic - Program buttons (Lesson 4.1)

Sofia Maconi avatar
Written by Sofia Maconi
Updated over 2 months ago

Transcript

Let's explore the Workflow tab.


At the moment, the workflow tab is actually empty, meaning that we have not created any workflows on our page yet.

So let's go ahead and create a workflow.

I'm back on my waitlist page, and if I scroll down, I have a button and an input to sign someone up for my waitlist.
The way to start workflows would usually be via an action such as a button.

So if I click on the button, I can see that the property editor is displaying Edit Workflow.


So let me click Edit Workflow, and I can see that the first step in the workflow has been created for us, and it's called Button Sign up today is clicked.

Okay, so what next?

Well, I would like to collect someone's email address and store that in the database.


I'd also like to send them an email to recognize that I've done this and to let them know that they're on the wait list.
And there are many more actions I can run after that as well.

But let's look at the options that we have.

We have account-related options. So at this stage, we could sign someone up if we wanted to. We could log them in, we could sign them up with social networks, etc.

But what I would like to do is just store their email in the database.

Now, my database currently isn't set up for storing people's emails, so let's do this now.


I'm going to create a new thing.

And at the moment, we have three data types here: Project, a Reminder, and a Task.


There is a User data type, but the way to create users in the database is via the signing-up action.

I'm going to create a new type. I'm going to call this Waitlist.

And quite simply, Waitlist will simply have an email field, and an email, we know, is just of type text.


So I'm going to head down to the basic types, and we're just collecting a text input.

Fantastic.

So now Bubble is saying, "Okay, so it looks like you want to create some data in the database. But where is that data coming from?"


And this is where we need to point the email equals to the input.

So if we go back to the UI design, I have an input here.
It's called Input Email Address.

Okay, let's go back to our workflow. All I need to do is search for this input, because that's where the data is being entered in.


Fantastic.

So that will create a new row in the database in the Waitlist table.

But what next?

Well, why don't we also send them an email?


So let's click on the plus button, head down to Email, and Send Email.

During the testing process, Bubble actually allows us to send emails via their built-in email process. But you can actually connect to any email service that you like. Maybe it's Mailchimp, maybe it's SendGrid. You can simply install a plugin and get up and running in no time.

Who would we send this email to? Well, it would be the email address. So I could select Input Email Address's value. I could statically type in my own email address, subject, and body. And I'll also note that this can be dynamic. We can capture a person's name and use merge tag functionality to address a person by their name.

What happens after that?

Well, we can do numerous things. Maybe we can take a payment because maybe the wait list has a 50% discount.


So we could charge the current user, set the amount, set the amount and the rest of the data, and actually take payment up front.

And then perhaps we can navigate them to a new page that says, "Congratulations, you're on the waitlist."

So, as I've demonstrated, workflows are super, super powerful. You can create any combination of steps that you'd like. So go ahead — start experimenting with workflows.


Your imagination is the only limit.

Did this answer your question?