jaxnz Posted April 21, 2019 Report Share Posted April 21, 2019 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 Quote Link to comment Share on other sites More sharing options...
0 cheonsa Posted April 21, 2019 Report Share Posted April 21, 2019 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: 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. Login from one form and redirect based on which table that user is in You can create a Stand Alone Login Screen that will redirect the user based on Roles or User Type. Kindly check this link: https://howto.caspio.com/tech-tips-and-articles/common-customizations/create-user-specific-redirect-after-login/ Hope this helps. -kristina Quote Link to comment Share on other sites More sharing options...
0 jaxnz Posted April 21, 2019 Author Report Share Posted April 21, 2019 Hi Kristina, Thanks for the response, so would I use the main table as the authentication table? Also wouldn't it be bad practice to store passwords in plain text and have duplicate data? Jackson Quote Link to comment Share on other sites More sharing options...
0 Aether Posted April 22, 2019 Report Share Posted April 22, 2019 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 Quote Link to comment Share on other sites More sharing options...
0 Glitch Posted July 5, 2019 Report Share Posted July 5, 2019 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(); Quote Link to comment Share on other sites More sharing options...
Question
jaxnz
Currently I have two tables to represent two different types of users, each user logs in with email and password.
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
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.