Key number associated to name

Hello, 

I am a bit confused as to how to go about this. I'm creating an app sheet where a key number is added if this key already exists in the google sheet database then it should display the name associated with the key. The key is in column A and the name is in column b. I am thinking to use the show type but am unsure what expressionI need to use for it to display my data accordingly. Please let me know. 

 

Thanks

0 5 234
5 REPLIES 5

I wasn't 100% clear about your ask, but could this help?

https://help.appsheet.com/en/articles/961466-row-labels

First, it not a good idea to allow users to choose values to be used as a key.  Instead, I would strongly recommend using a dedicated key column that is automatically assigned a unique value from the UNIQUEID() function.  See article at bottom.

Now, to identify if a value already exists or not.  In each Column there is a Valid_If property that allows you to insert an expression to test if the value is valid.  In your case, you want to see if the entered value already exists.  You can do that with an expression similar to this (you'll need to change the column and tables names for your app):

IN([_THIS], TableToCheck[ColumnToCheck])

NOTE: "[_THIS]" is a valid keyword you can use to refer to the current column's value.  Use it as is.

Next, you can create a message in the "Invalid value error" property that is displayed when there is an error or, for you, a duplicate.  You can create it to show the Name like this:

"The value already exists for " & ANY(SELECT(TableToCheck[Name], [ColumnToCheck] = [_THIS])) &"."

I hope this helps!  Please ask your questions. ๐Ÿ˜€

https://help.appsheet.com/en/articles/2357317-uniqueid

 

Hello, 

Thank you so much for the insight.

The key is already created when the database (google sheet) gets a new row this step automatically runs. The user will get this key and use it in the app sheet if the key entered matches a key in the database then the associated name from the google sheet appears. Column A in google Sheets lists all key values and column B lists the name associated with the key. I am not sure how to figure the step out when user entires key value the matching name should show up/

I am guessing,  but it seems like you might be trying to use a Form for the Table which has the pre-generated Key and Name?  I assume to fill out additional user details?

The problem is Forms load either in New mode OR in Edit mode.  You can't switch  after the Form is loaded.  In other words, you can't launch a blank Form, enter the Key value and then have the Form switch to Edit mode IF it finds the key already exists.

What I recommend that you do, is create a simple table and Form solely for the purpose of entering the given key.  This Form can lookup and validate if the key is good.  If it is, then tapping Save will take the user to another Form (the original one you are trying to use) that is loaded with row information - Key and Name and any other details previously entered.

CAUTION If this is an attempt to get around the usual login feature, please be aware that this is a very insecure way to do it.  If security is important in your app, you do not want to use the approach you are attempting.

Thank you, are there any app sheet templates that serve a similar function?

Top Labels in this Space