Self-Registration & Public Forms
Normally, to enter data into Clay, a Clay 'User' is required, and the person must first login to Clay using the username and password for that User before he can enter data. This raises the often-asked question of how one can provide a self-registration portal using Clay, where users add themselves to Clay and then login. This means a form must be provided which they can access before these Users exist in Clay, in which they can enter their User information. Similar to this question is whether Clay can allow any unregistered person the ability to enter data into any table in Clay. For example, for an anonymous user of software to fill a Bug Report without being added as a User in Clay. There are several ways to achieve this:
The easiest method which involves the built-in Clay point-and-click interface and no programming, is to use the Role-based login feature in WebClay. The procedure is as follows (assuming the table is the 'User' table):
- A Role is added to Clay which only has access to Add records into a certain table. For example, a Role called 'Registration' which only has permissions to Add new records to the User table without Read permissions, or permissions to any other table.
- Some additional permissions may need to be added to the Role depending on what appears in the form. For example, if you want the person to pick from a list of Workgroups, you need to also add 'Read Names' permission for the Workgroup table.
- Add at least one User for this Role. It can be any username, for example 'Register1'. You can leave the password empty or enter a password if you want to restrict access to only people with the right URL. You only need more than one user for registration purposes if you wish to allow more than one concurrent registration. You can read about the rules of Role-based logins here.
- Set up a simple Layout for the User table with minimum fields and everything else hidden, a layout which is assigned to the 'Registration' Role only.
- Provide the WebClay URL to the User as follows, e.g.: http://myserver.com/clay.dcw?r=6&dtbl=15&u=role:Registration where dtbl=15 is the table ID (in this case 15 is the ID for the User table), and where 'Registration' is the Role name. This URL can be added to any web-site page, or sent to the user via e-mail.
- The login will happen automatically behind the scenes when the user loads the URL and the 'registration form' (AKA the layout assigned to him for the User table) will be shown automatically. If he fills the form and presses a Save button, the new User will be added to Clay and he can then relogin using this User.
- Automations can be built that block some Users from being added according to rules, or which notify the new User of a successful registration with further instructions, etc.
Alternatively, there are two other methods to achieve this using some programming:
- Create an HTML form using any web site editor or using the Clay Data Form Generator, and enter the results of the form into Clay using Data Injection.
- Use REST API to programmatically enter the data into Clay.
Note that both of these methods require the code to first login to Clay using a User as well.