I have a table (and a view) called "Sign In" ...

(Joseph Pentheroudakis) #1

I have a table (and a view) called “Sign In” for user sign-in on a published-app-to-be. The computed key for the table is Date:Email.

I’d like to test whether a user is already signed in so I can display a message. [Sign-in also requires a PIN and a member number for authentication; yes, I know that’s not 100% secure, but it’s secure enough in our context]

Right now if I’m already signed in and try to sign in again I get the message in the screenshot. How do I test for that state?

(Reza Raoofi) #2

Can you clarify your current Sign-in process a little bit? I am guessing once a user signs in, a record is saved in sign-in table, and the above message is the automatic error AppSheet returned based on the computed key which you are trying to avoid somehow; am I right?

(Joseph Pentheroudakis) #3

@RezaRaoofi exactly :=)

(Joseph Pentheroudakis) #4

@RezaRaoofi couldn’t have done it without your help :=) Thank you!

(Reza Raoofi) #5

You are welcome Sir! :wink:

(Joseph Pentheroudakis) #6

Clarification: yes, I’d like to avoid the error message but also post a message of my own to let users know they’re already signed in. I guess the simplest solution would be to allow me to localize that error message if possible. (change it to: “you are already signed in” or some such)

(Reza Raoofi) #7

Then in the same sign-in page you should be able to have a lookup(…) function to checks for existing signed in users and if it exists it could show a text on screen using for example a Show column.

(Reza Raoofi) #8

Or you could use the new Error_Message_If_Invalid for the sign-in name; if the sign-in name already exists it won’t be valid and you will also display a custom message.

(Joseph Pentheroudakis) #9

@RezaRaoofi I’m using the Error_Message_If_Invalid to verify that they’ve entered a well-formed email, actually. The message doesn’t appear if the email is well-formed, even that email already exists. It appears later, when the user saves the form, which must be when the system checks for duplicates.

I can live with the current wording, but it sure would be nice if I could localize it…

(Reza Raoofi) #10

+Charlie Wells Well, if you are already using Error_Message_If_Invalid, then you just need to change the condition inside Valid_if to also check for existing email in Sign-in table, so it would be invalid if exists, and user will see that custom error message.

If you do not catch it by Valid_if condition, then AppSheet will check for duplicate Key only upon save.

(Joseph Pentheroudakis) #11

@RezaRaoofi thanks! so now I get this…

(Joseph Pentheroudakis) #12

@RezaRaoofi … or this:

(Reza Raoofi) #13

+Charlie Wells Looks nice! You made it man! :slight_smile: