Introduction to the Formula Builder UI and How to Go About Building Your First Formula.
Hey guys, today I want to walk through just a brief introduction to our Formula Builder UI and walk through how to build a simple Formula using that UI.
1) So let’s go ahead and get started. To start, I am just logged into the Cloud Elements Console here, and I am just going to click on Formula Catalog.
2) You’ll see at this point I do not have any Formulas in my account, so let's go ahead at the top here click build Formula, and this will launch what we call our Formula Builder UI.
3) So, to get started I’d first recommend checking out any documentation in our dev portal that you can find here if this is your first time. I’m going to assume you've looked through some of that and are ready to go ahead and get started.
Let’s go ahead and give the Formula a name first. I am going to call it CRM to Email. Let’s go ahead and click go.
4) Just some background, what I want to build here is a Formula that listens for events on the CRM Element and then sends me an email with what just happened in that CRM Element each time something has changed. What I want to do first is select what type of trigger I want. So, for that Formula we’re going to want an event trigger.
5) The only property you need for an event is what Element instance you are listening for. I am going to choose Salesforce.
6) I have a Salesforce Element instance provisioned that has events enabled, so I'll go ahead and choose that and click save.
7) This will bring us to our Formula tree view. At this point, we only see the trigger as we add steps. You'll see kind of how the Formula flows in the whole tree view, but right now we just have the trigger so let's go ahead and start adding some steps. So the first step we want to add is what’s called a script step.
9) Now, this step is going to be what actually calls our “send-email” API. So that's going to be an “Element Request” step which makes an API call to an Element instance API.
11) Now let’s connect these steps together. So after the trigger runs successfully, I want to construct the email body, and after the construct email body step runs successfully, I want to go ahead and “send-email.” Great, so now we have our steps all set up, and now let’s go ahead and create a Formula Instance.
12) So, just going to call it “my formula instance”, and click save. At this point we can actually trigger an event to occur from the Salesforce account, and let’s see if we get an email.
13) I’ll navigate over to Salesforce and create a new account in my Salesforce called “JoshTestAccount” and click save, and now after clicking save what should happen is an Element should come into the Cloud Elements platform. I have an Element instance tied to this Salesforce account that is listening for events and that should have kicked off our Formula instance that we created, and I should have received an email saying what just happened.
14) So let’s run over to my email. Perfect, looks like I just got a new email that says “Account with ID … was created”.
So, perfect, we have created a Formula, created a Formula instance, and we are now listening for events from Salesforce, and using a “SendGrid” Element to go about sending an email with some of the data on that event. Thanks guys!
About the Author
Vivek is a Marketing Intern at Cloud Elements.More Content by Vivek Ravishankar