The Caspio Low-Code Platform
All the Tools and Support You Need
Unlimited Users With Every Plan
Part 3 will teach you how to build a relational form, with a one-to-many relationship, to set up a full-on database application. Here’s a demo of the form.
After inputting some sample data pertaining to a service request and hitting Submit, a Request ID will be passed to the next page.
That same Request ID will be used when assigning tasks. For example:
It’s also possible to add multiple tasks and submit them under the same request. In this case: we can assign a new task to Raj Singh, input “order blinds” in Comments, input another date in Resolve by, then click Add. We can always go back to page one if we want to submit a new request.
This is a simple one-to-many relationship where we can track and see all the tasks pertaining to a single request. In this video, we’re going to show you how to create that relationship between the two tables.
If you’ve seen the first two videos, you already understand the process of building an application in Caspio — first, log into your account and click the New App link on top. You’ll then be given two ways on how to begin:
Click the second option to build your application from scratch.
You’ll then be prompted to name your app — input Relational Form and click Finish to see your app listed on your Home screen.
Next, click the Open link of your new app to access its App Overview. You’ll find all the necessary objects to create an app on the left-hand panel.
The most important thing you should build first is your database table.
Tables are the foundation or backbone of any app you develop. For this use case, you’ll be creating four:
Begin by clicking the Tables object on the left-hand panel.
TABLE 1: uvg_requests
Click the New Table link on top and list the following fields with their corresponding DataType:
Take note of the following with regards to the data types used:
Click Save on top and name your table uvg_requests, then click Finish.
TABLE 2: uvg_tasks
Note that the Request_ID field in this table functions as a foreign key. Associating it with the primary request ID field from TABLE 1 will establish a relationship.
Click Save on top and name your table uvg_tasks, then click Finish.
TABLE 3: uvg_categories_lookup
Your last two tables will function as data sources for dropdowns on the submission form. Follow the steps below to build your first lookup table:
TABLE 4: uvg_locations_lookup
Go back out to the Tables menu and build your last lookup table. Follow the steps below:
Go back out to the Tables menu to find all your tables listed.
Caspio also allows access to your table relationships. Click the Relationship link on top to make changes.
Follow the steps below to implement a one-to-many relationship between TABLE 1 and TABLE 2:
A single request can now be linked to many tasks. This, in a database environment, is referred to as a one-to-many relationship, where one item from the parent table can be linked to many items in the child table.
Go to DataPages on the left-hand panel and click the New DataPage link on top. This will open Caspio’s point-and-click DataPage wizard to help you build your app interfaces.
DATAPAGE 1: Patient Intake Form Part 1
Wizard Step 1 – DataPage Type
Click Next to continue.
Wizard Step 2 – DataPage Data Source
Under DataPage Properties, configure the following fields:
Wizard Step 3 – Select Fields
Apply the following changes:
Wizard Step 4 – Configure Fields
Make the following changes under DataPage Elements:
Go to the Advanced tab:
Follow the steps below to add a simple heading:
Wizard Step 5 – Destination and Messaging
Make the following changes under Destination Options:
Click Finish to save your work.
DEPLOYMENT 1: form_3.html
Follow these steps to deploy using the Embed method:
The expected behavior here is upon submission, you’ll be redirected to a different URL in your directory.
Go back to the Caspio platform and click the New DataPage link on top.
DATAPAGE 2: Request Details
This DataPage will allow you to see the details of your submitted request from the previous screen.
Wizard Step 3 – Search Type
Make the following changes:
Wizard Step 4 – Select Filtering Fields
Wizard Step 5 – Configure Filtering Fields
Go to the Advanced tab and make the following changes in Request_ID:
Wizard Step 6 – Select Details Page Fields
Wizard Step 7 – Configure Details Page
Click Finish to save your work and proceed to deployment.
DEPLOYMENT 2: form_3_request_details.html
Follow the embed process outlined in DEPLOYMENT 1 but paste your deploy code in its designated section on the second web page (form_3_request_details.html).
DATAPAGE 3: Request Details
The last DataPage you’ll build is a report to assign tasks pertaining to a specific request.
Follow the same changes in DATAPAGE 2, Wizard Step 3.
Follow the same changes in DATAPAGE 2, Wizard Step 4.
Follow the same changes in DATAPAGE 2, Wizard Step 5.
Wizard Step 6 – Select Results Page Fields
Include the following from your list of Available Fields to your Selected Fields:
Wizard Step 7 – Results Page Editing Options
Wizard Step 8 – Configure Results Page Fields
Note that you can also link this field to a user table.
Wizard Sep 9 – Results Page Options
Use the default settings and click Next to continue.
Wizard Step 10 – Details page
DEPLOYMENT 3: form_3_request_details.html
Upon submitting your request form, you’re passing the request ID to this webpage. That is why you’re able to filter details and assign tasks pertaining to a specific request.
To verify if the assigned tasks belong to the right request, view your request table (uvg_requests) and compare the request ID to the one stamped in your task table (uvg_tasks). You’ll find that both IDs are the same. You now understand why this is a one-to-many relationship — one request has multiple tasks.
In the next video, we’ll teach you how to build a payment form.
Share this post:
Caspio is the world’s leading cloud platform for building online database applications without coding. Start a free trial today and experience the power of no-code.
© 2023 Caspio, Inc. Sunnyvale, California. All rights reserved.