Using a code or abbreviation to fill out a form

How can I make it to where I can type in a code or abbreviation in a form field and have it pull up the full name. Example. I type in “brsg” and it returns with “brown sand and gravel”. I have all these abbreviations with what they stand for in a table but do not know how to make the connection.

Hi Tyler! Welcome to the AppSheet Community!!

AppSheet has a way to handle your use case easily. There is an ability to create a table with a key/label pairing such that when you select a row based on its key, the app will actually display the label value.

To elaborate, you would create a table, lets call it “Products”, with two columns (at least - could be more if needed), something that looks like:

Code        Description
----    ---------------------------
brsg     brown sand and gravel
grsg     grey sand and gravel
whsg     white sand and gravel

You would set Code as the key and Description as the Label column. See example below where Group ID would be the code and Name is analogous to Description

If you were using these codes in an “Orders” table you might have a column named Product which is of Ref type to the table “Products”. By default, this column will be presented as some choice list. You can control which one in the Product column - buttons, dropdown, etc.

Also by default, I believe, this Ref column will show ALL of the rows from the referenced table - Products in this case - and because of the Label set as above, the Description value is what is displayed.

When you SAVE the hypothetical Orders row, the key value is actually saved into the Product column of the Orders Row. However, anytime you view that Orders row in the app, AppSheet will always automatically display the Description value for that Product because it is set as the Label.

See the articles below for more issues

TIP: When it is the case that users are accustomed to using the Code instead of the Description, I like to include a dedicated label column that concatenates the Code and Description together and use it as the label. For example: “brsg - brown sand and gravel”. this allows users to search by the code OR any value of the actual description of the item.

2 Likes