Building Your First App
Last updated
Was this helpful?
Last updated
Was this helpful?
We recommend building a simple Contact Form as your first application, and we've provided a tutorial for doing so in two mediums: a video and a written tutorial, both of which cover the same material. Feel free to go through both, to use either exclusively, or to supplement one with the other – whatever is most conducive to your learning style.
[block:embed] { "html": "<iframe class="embedly-embed" src="//cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FAoRcjWC5Q4Q%3Ffeature%3Doembed&display_name=YouTube&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DAoRcjWC5Q4Q&image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FAoRcjWC5Q4Q%2Fhqdefault.jpg&key=f2aa6fc3595946d0afc3d76cbbd25dc3&type=text%2Fhtml&schema=youtube" width="854" height="480" scrolling="no" title="YouTube embed" frameborder="0" allow="autoplay; fullscreen" allowfullscreen="true">", "url": "https://www.youtube.com/watch?v=AoRcjWC5Q4Q", "title": "Airkit 101 - Build Your First App in 10 Minutes", "favicon": "https://www.youtube.com/s/desktop/15c06292/img/favicon.ico", "image": "https://i.ytimg.com/vi/AoRcjWC5Q4Q/hqdefault.jpg" } [/block]
Here, we'll cover how to build a Contact Form app from scratch. The app will guide users on a Journey that captures their contact info and then store that information back to AirData.
These are the Studio parts you will be working with:
Creating the Data Flow to Insert Data
Connecting the Data Flow to the UI
Since the Contact Form app will be triggered by a link, select Clicks a link.
Click on the '+' icon next to the starting point to add the action that will occur when users click on that link. Among the many options, look for the Navigate to Web Flow Action.
You will be prompted to select which Web Flow to Navigate to. Since the app doesn’t have any Web Flows yet, add one by clicking on Add Web Flow.
To build the Web Flow, you can double click on the added Web Flow or toggle over to Web Builder, where the UI for the application is actually built.
The Contact Form Web Flow will include two Web Pages: A Contact Info Web Page and a Thank You Web Page.
Click on the '+' icon next to the Web Page to add the Web Controls one by one. There are different types of Controls, each serving a specific purpose.
To edit the Label, double click on it in the Stage or change the Text property in the Inspector section. You can also change the style of the Label by choosing a Variant.
Edit the name by double clicking on it or from the Text in the Inspector section.
Now that the Form is ready, click on the Web Page to check all the auto-created Variables that will store the input Values. If necessary, rename the Variables so they are easy to identify. For example, change text_input to name_input.
Add a Thank You Web Page to the Web Flow for users to see after completing the Form.
Click on the '+' icon next to the Web Flow and add the second Web Page. Double click on it to edit the name for a more descriptive one.
Click on the '+' icon next to the new Web Page to add the Label Control.
Type the message users will see on submitting the Form by editing the Label.
From Data Builder, click on the '+' icon next to Datastore and select Add App Object.
Click on the '+' icon next to the recently added object and include the fields that you need. In this case, it’s going to be a Text type, for the name and company fields; a Phone type for the phone number; and an Email type for the email address.
Double click on the App Object as well as on the fields to rename them. We recommend using lower case.
Finally, save the app to run a migration and create the AirData Table where the information will be saved later on.
From Connection Builder, click on the '+' icon next to Data Flow and then on Create Blank to add a new Data Flow.
Once added, double click on it to rename it.
In the Inspector section, add the Inputs that will enable you to pass the Values from the Form Inputs to the Data Flow and back to AirData. When all data types display, select the Text input and rename it to “name”; select the Phone input and rename it to “phone” and do the same with the other two fields.
Add an AirData Request Data Operation by clicking on '+' the icon in the Stage.
Inside the AirData Request, choose from the dropdown the App Object that will save the information and select INSERT as the Type of operation to perform since it allows adding an item into AirData.
Since AirData expects a full JSON object to pass in, create the “Contact” object inline. You can check out the schema from the sample data of the App Object, by going to the Start step and adding the Contact Object as a Variable.
Then, copy the schema from the Variable tab:
Go back to the AirData Request step and paste the schema to adjust the sample text to the Inputs. Hence, replace “Sample Text” with the “name” input; the phone number with the “phone” input; and so on.
To test the Data Flow and make sure it is sending the information back to AirData, go to the Run Results section and click on Run. A “Successfully run step” message should pop up.
Save the application and go to Data Builder to check if the data was inserted.
Now that the Data Flow is working and sending data to Data Builder, go back to Web Builder to connect the operation to the UI. In Web Builder, you can define the Action Chain to be run when the users click on “Submit” once they finish completing their Form. This Action Chain is triggered by the Airkit Event of a user clicking the button.
Click on the “Submit” button and go to the Actions tab in the Inspector.
Click on the '+' icon for the Actions menu to display and select Run Data Flow from the Data Options.
Pick the previously created Data Flow and complete the displayed Inputs with the Input Variables of the Web Page. They will be suggested as you type:
Repeat the process to add an action to the button and this time select the Navigate to Web Page action. Choose the Thank You Web Page so that users are directed there when clicking on the button.
Save the app and it will be ready to be tested.
Once the app is all set, it can be tested in the App Preview.
Click on Preview at the right-hand corner of the Studio, which will open a new tab.
Click on the globe icon, which allows the app to be launched from the start.
Complete the fields and click on “Submit”.
As expected, it will take the user to the Thank You Web Page.
Finally, go back to Data Builder and check if the entered information has been saved into AirData:
Now the application is ready to be published.
: Start the Journey
: Creating the Contact Form UI
: Creating the App Object in AirData
:
: Previewing the App
When creating an app, you will first land on in the Studio. This is where the app’s Journey is created by choosing a Starting Event.
The article goes into more depth on what Web Flows are and how they are used.
In , double click on the recently added Web Flow to rename it and click on the '+' icon next to it to add the first Web Page. Double click on it to edit the name for a more descriptive one.
Web Controls are basic UI building blocks that allow users to interact with a web app. They’re things like , , and . Much like how Web Pages are the component parts of Web Flows, Web Controls are the component parts of Web Pages.
Each Web Control is different, because each component part of a Web Page must interact with users in a different way. , for instance, only need to be read, where as must be able to bind user input to a variable that can be called on at some point downstream.
For a deeper dive into individual Web Controls, see .
This Contact Form includes Input Controls, that is, fields the users will later complete. The Input Controls on this Form are the following: Name, Phone, Email and Company. Hence, choose the Control for the “Name” and "Company" fields, as users are expected to enter a text; choose the Control for the “Phone” field, as users are expected to enter numbers following a phone format; and choose the Control for the "Email" field.
The Text Input Control, Phone Input Control, and Email Input Control all accept as user input. (In Airkit, both and types are subcategories of Text.) However, while the Text Input Control accepts any and all strings as valid input and binds them to the associated variable, the Phone and Email Input Controls first run a test to confirm that the string the user gave was a properly-formatted phone number or email (respectively) before binding the input to the associated variable. If the string the user gave was not properly formatted, the associated variable will remain NULL
.
Note that while this built-in validation process prevents your Airkit apps from saving inappropriately-formatted data, it does not automatically communicate any part of this validation process to users. If you want to include intuitive error messages in your applications, construct them according to the process outlined in .
For each Input Control, a is automatically created and binded to the Value of that input.
Once the Controls are added, include a above each of them to show the user what input they are filling out.
Every Web Control has associated Variants: cosmetic variations that appear differently but function identically. Variants can be edited in and then used as defaults when adding new Web Controls. For instance, within a single application, you might create two Variants of button: a rectangular one in red, and a round one in blue. Any changes made to existing Variants also apply retroactively: existing Web Controls previously styled according to the old default will immediately take the form specified by the new default. This allows for consistent branding throughout the entirety of each user's Journey, and it also makes it easy to see how different combinations of colors, fonts, and graphics look together.
Finally, add a . This will be later used to submit data collected from users to AirData.
To save the information in the app, an has to be built in .
A has to be created from to send the data back to .
For a deeper discussion on Data Flows, see . For more information on the different kinds of Data Operations available, see the .
When a value is bound to a variable, that value is tied to an individual . This simplifies the process of keeping track of information in the short term. If our contact form becomes published, and both Alice and Bob fill it out at the same time, the value of name_input will be different in Alice's Journey than in Bob's. Airkit will handle the details of keeping them separate.
For a deeper diving into how data is conceptualized in Airkit as well as the crucial difference between binding data to a variable and saving it to AirData, check out .
Actions are a broad category. They can be do everything from to to . There's also the Action, which makes it possible to create branching Action Chains, where different Actions are taken depending on whether or not certain conditions are met.
For more on how to created an Action Chain, see documentation on , which is where **Action Chains **are defined. For more on the different kinds of Actions that can be taken, see
In the context of the Airkit platform, Events refer to any catalyst that might trigger an . All Action Chains are associated with a particular Event. It is when – and only when – an Event is fired that its associated Action Chain is performed.
When we say that Events tell the platform "something happened," we are being deliberately vague. All kind of things might trigger Events. A user clicking a is an Event, as is the , as is updating a .
There are many different types of Airkit Events, including , one of which you've already created in the , and , including the 'Clicked' Event associated with all .