Build a Custom CRM

Summarized Video Transcript

Part 3 will teach you how to create authentications, and how users can view different app functionalities based on their privileges.

The last thing you learned in Part 2 was how to create a simple relationship between the staff table and the contact table. Given that your staff table (SCRM_tbl_staff) contains all the employee credentials, it will also serve as your user table.

The following section will show you how to filter for active managers and employees.

Creating Database Views

Views are used to filter out information you want to see from your tables. So go ahead and click Views on the main left-hand panel to get started.

You’ll need to create two for this tutorial, one for each user role:

VIEW 1: SCRM_Active_Managers

Click the New View link on top and name it SCRM_Active_Managers. Your goal here is to only filter active managers from the staff table.

Screenshot of Caspio’s app builder. It shows the “Views” section, under “New View”. It displays the “Create a New View” step.

Select SCRM_tbl_staff from your list of Available Tables, then click the “>” symbol to include it in your list of Selected Tables. Click Next when you’re done.

On this screen, click on the Criteria tab on top. Here you can configure field properties by dragging and dropping logic elements to define your filtering conditions.

Screenshot of Caspio’s app builder. It shows the “Views” section, under “New View”. It displays the “Field Properties” step.

You only need to take the necessary elements from the left-hand side and snap them in place on the right. And if you want to start over or remove a mistake, just drag those puzzle pieces over to the trashcan icon on the lower right. The only piece you can’t move anywhere or delete is the original anchor.

To define the filter logic of your active managers, proceed with the following steps:

  1. Take the dark gray Logic Element and drag it over to the orange AND anchor on the right.
  2. Select SCRM_tbl_staff_Role in the first dropdown menu of your Logic Element.
  3. Make sure that the next two dropdowns have Equal and Value selected.
  4. Type in Manager in the textbox that follows.
  5. Take another dark gray Logic Element and drag it into the same AND anchor.
  6. Select SCRM_tbl_staff_Status in the first dropdown menu.
  7. Make sure that the next two dropdowns have Equal and Value selected.
  8. Check the box that follows.
  9. Click Finish when you’re done.

This View will now filter and display active managers. But notice when you click Open inside the container for SCRM_Active_Managers, it doesn’t show any data. That’s because your staff table has no records at the moment.

Resolve this now by clicking the Tables object on the main left-hand panel and opening SCRM_tbl_staff. Next, find the following columns and input the suggested sample data in the Datasheet tab:

  • Name
    • John Doe
    • Kelly Smith
    • Tom Jones
  • Email
    • doe@company.com
    • smith@company.com
    • jones@company.com
  • Password
    • Type in “test” for all rows.
  • Role
    • Manager
    • Employee
    • Employee
  • Status
    • Check the box for all rows to flag them as active.
Screenshot of Caspio’s app builder. It shows the “Tables” section and is opened at the “Datasheet” tab.

When you’re done, go back to the Views object and open SCRM_Active_Managers — John Doe’s credentials should be the only one present.

Screenshot of Caspio’s app builder. It shows the “Views” section, opened at the sample file, “SCRM_Active_Managers”.

Go back to the Views object when you’re done checking.

VIEW 2: SCRM_Active_Employees

Your second View will be filtering for active employees, who in this case are Kelly Smith and Tom Jones.

To set it up, click the New View link on top and name it SCRM_Active_Employees. Then select SCRM_tbl_staff once again from your list of Available Tables, and include it to your Selected Tables by clicking the “>” symbol. Click Next when you’re done.

Follow the same procedure outlined in VIEW 1 when defining the logic criteria, except type in Employee instead of Manager in step 4. This will differentiate the logic from your active managers view.

Once you’re done, click Finish and open SCRM_Active_Employees. You should only see Kelly and Tom’s credentials in the resulting table.

Screenshot of Caspio’s app builder. It shows the “Views” section, opened at the sample file, “SCRM_Active_Employees”.

This is how you separate your user groups in Caspio. Remember that once you have your role fields defined — you can use Views to separate them, filter the proper information and decide who has access to certain forms and reports.

Setting Up Authentications

The next step is to go and build login forms based on your existing Views. One will be for the managers and the other for your employees.

Click the Authentications object on the main left-hand panel to get started.

AUTHENTICATION 1: SCRM Manager Login

To begin building your manager login, click the New Authentications link on top. Then for your Authentication data source, select SCRM_Active_Managers.

You’ll now have two Setup options to choose from:

  1. Express – The quickest way to create authentications for your app, but only allows two login fields: Username and Password.
  2. Custom – Allows you to have more customization options.
Screenshot of Caspio’s app builder. It shows the “Authentication” section and is opened at “New”.

This tutorial will cover the Custom setup option so go ahead and click the second radio button. Here, users are validated in one of four ways:

  1. Caspio data source – This recommended option is essentially Express with more customizations. You can also use your Caspio views here.
  2. ID Services – This option allows your users to log in using their Twitter, Google or OpenID accounts to access your app.
  3. Caspio & ID Services – This option allows user authentication through both social media and the data you have inside Caspio.
  4. SAML Single Sign-On – If you already have an online repository where you store employee credentials, you can use those same credentials to log into your Caspio app simultaneously. So instead of having separate authentications, employees can use their existing accounts. Note that this option is only available on corporate level plans.

Validate with a Caspio data source by clicking the first radio button. This will unlock more configuration options for your authentication form.

Screenshot of Caspio’s app builder. It displays a segment of the “Authentication” section, showing the “Configure Authentication” menu.

Under the Elements panel of the resulting window, you should be able to view your default Authentication Fields. The only change you’ll need to do here is rename the Label of your Email field from User name to Email. This is to intuitively signal users on what to input when logging in.

A segment of a screenshot showing the “Elements” tab, under “Configure Authentication” menu of the “Authentication” section. It shows the “Advanced Settings” panel.

If you scroll down and expand the section for Advance Settings (Optional), you’ll find more setup options to explore and use. But this tutorial will simply use the default settings. When you’re done, click Create and name this authentication SCRM Manager Login.

Now you have a login screen that only allows John Doe to sign in.

AUTHENTICATION 2: SCRM Employee Login

To build your employee login screen for Kelly Smith and Tom Jones, follow the same procedure of your first authentication.

The only difference lie in selecting SCRM_Active_Employees as your Authentication data source, and in naming the authentication SCRM Employee Login.

Screenshot of Caspio’s app builder. It shows the “Authentication” section and contains two items: “SCRM Employee Login” and “SCRM Manager Login”

Both login screens are now ready to be deployed onto your app widgets or DataPages. This is really as difficult as it gets when setting up a Caspio foundation.

See You in the Next Video!

Join us in the next video where we’ll begin building forms and reports.

You’ll quickly learn how they can be used to create workflows, submit data, view information, generate charts and graphs, and implement other functionalities.

Next Steps

NEW IDC WHITE PAPER
See why low-code developers are growing 3x faster than traditional developers.
TALK TO AN EXPERT
Have a vision for an application? Talk to a Caspio product expert and we’ll help you achieve it.
SEE CASPIO IN ACTION
Want to see if Caspio is a good fit for your needs? Choose a date and time for a personalized demo.