Jump to content
  • 0

Multi Table Email Login


jaxnz

Question

Currently I have two tables to represent two different types of users, each user logs in with email and password. 

  • Is it possible to have one registration form  and insert the data to the correct table based on a drop-down selection?  e.g. UserType1 / UserType2
  • Verify that email hasn't been used in either table on registration 
  • Login from one form and redirect based on which table that user is in

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @jaxnz,

 

For your first inquiry, "Is it possible to have one registration form and insert the data to the correct table based on a drop-down selection?  e.g. UserType1 / UserType2"

     You will need to have a Main Table that will hold all the registrations. Then, create a triggered action for that table that will insert a record to a table for the first user type for example Admin. Then, for another user type. Please see attached screenshot below:

image.png.f79b48530f1b4a40c9d0f6769428d7d9.png

The DataType of your Password field must be Text(255) for you to copy the password to other tables.

 

  • Verify that email hasn't been used in either table on registration 
    • You can set the Email in the Main Table as Unique.

 

 

Hope this helps.

 

-kristina

Link to comment
Share on other sites

  • 0

Hi @jaxnz, you can use a separate table for the "user table" in storing of the credentials (and it will also depend on your table relationship or workflow).
Also please note that you cannot use the "Password DataType" in the trigger action.

For further information, check this documentation and video tutorials:
Trigger action: https://howto.caspio.com/tables-and-views/triggered-actions/
Data Normalization: https://www.youtube.com/watch?v=oexOYUUyQik 
One-to-Many Relationships:
https://www.youtube.com/watch?v=IstAk982ntA

 

Link to comment
Share on other sites

  • 0

Hello Janx,

Would it be necessary to separate these tables?

In my opinion, you can filter that out using Views. 

From that single table, you'd be able to redirect based on user roles anyway.

Here's the link for that: https://howto.caspio.com/tech-tips-and-articles/common-customizations/create-user-specific-redirect-after-login/

You are correct when you said that it is bad practice to make the Password field a Text DataType, not to mention that there are high chances that your DataPage will get reported. 

I suggest that you have a single table instead. Since, DataPages can only have on DataSource anyway. If you still decide to have two tables, then that's going to be Two DataPages. 

Hope this helps.

Glitch();

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...