Unlocking a view with an access code

Hi there.

I have an account role “Customers” to which I want to assign a code that means that when they go to a view on the app they will have to enter that code to see the view.

My idea, somehow is that these codes would be assigned to a specific “Client” user role - I would add the access code to their Account Role (so they can update it whenever they want on the account settings page.

Does anyone know how I might setup a page where the user has to submit a form which just includes this access code?

Thanks

Why not just use the Customers role as the page security, negating the need for a special code?

OTOH, if you want different customers to have different codes so they can see different views you could hard code the Page Rules to hide certain views depending upon the code.

What’s the difference between the Customers role and the Clients role?

Sorry, badly explained.

I want people to have to enter a code into a page in order to see a view where there is a form. These people will have been previously sent a code by email so they know what to create.

That code will stored in the account details section of the “Client” role.

When the people enter the code the will be able to see a page where the corresponding form associated with the Client role will be shown.

That to me sounds feasible off the top of my head. Does it sound the same to you?

Your explanation was okay originally, I think. It just doesn’t tell us why you want to use a code vs. a simple role. But I digress. I think the problem is that Knack doesn’t allow us to create variables. So, for example. If you could open a page with a “field”, but really just a variable, enter the code into that variable, and if the code matches the account value, open your page. The value of the variable wouldn’t be saved, so next time the user would do the same thing. This probably requires a custom JavaScript solution.

I wanted a code because to give a customer a username and password is too complicated and prone to errors, whereas if a Client sends a code and a link, most people can manage that without getting into problems. By attaching it to the Client account profile it gives Clients the ability to regenerate a new code periodically the form page.

Okay so I managed to crack this issue by using a multipart form.

I added a field “access code” to the table that contained the records I would to add via the form.

I then created a multipart form where the first page is just the field with the access code field waiting for the user input.

A default form action takes a person to another page, in this case I just put in Google.

Rule one then takes people to a child page where they can then fill in the actual form, but only if they entered the right access code :wink:

Hope this helps others.

Okay, but this is a “hardcoded” solution. In order to change the code the builder first has to go into Knack and manually change the value in the submit rule.

Yes it’s not perfect but it’s a solution for me!