WorryFree Computers   »   [go: up one dir, main page]

How to create a pulldown that save an ID instead of displayed/selected value?

Hi, I'm newbie with AppSheet!

I have table [User] which used for display/input User info, this table have column like [Rank ID], [Area ID] linked to master tables.

I have some master tables such as [Rank], [Area], each master table has its own info column like [Rank ID] and [Rank Name], [Area ID], [Area Name], etc with these IDs from these master tables mapped with table [Customer] via correspond ID columns.

I'm creating an screen display data from/register data into a table [User] (which have some columns mapping with other master tables through IDs). Is there a way to create pulldowns that display [Rank] value, [Area] value (or other data) from master tables but when select a value from theses pulldowns and click Register button, it will save the corresponding ID value (mapped by master tables' IDs) to correspond column of [User] table instead?

The purpose of this processing is that I could use registered data by this AppSheet screen at other system (which have master-transaction table structure) by exporting data then importing to that system or, vice versa, export data from other system then import into AppSheet DB to be displayed at this AppSheet screen.

I tried to used refer and realized that it could link data but the pulldown is displayed ID value only, not the value I want.

That mean, I want to display [Rank].[Rank Name] at the pulldown but to save the corresponding [Rank].[Rank ID] (defined at [Rank] master table) into [User].[Rank ID] when register the form.

Please give me some advices. Thank you so much!

Solved Solved
0 1 32
1 ACCEPTED SOLUTION

Aurelien
Google Developer Expert
Google Developer Expert

Hi @Evendo 


@Evendo wrote:

I tried to used refer and realized that it could link data but the pulldown is displayed ID value only, not the value I want.

That mean, I want to display [Rank].[Rank Name] at the pulldown but to save the corresponding [Rank].[Rank ID] (defined at [Rank] master table) into [User].[Rank ID] when register the form.


You should be able to do so. It requires:

- the column [user] to be set with type Ref, and its source table to the table User

- same with column[rank] and table Rank

- and so on

Please keep in mind that when using Ref type, the id is registered. If you need to grab some other attributes, you could use chained dereferenced expression, such as: 

 

[user].[rankid].[rankname]

 

 

For reference:

Dereference expressions - AppSheet Help

 

 

View solution in original post

1 REPLY 1

Aurelien
Google Developer Expert
Google Developer Expert

Hi @Evendo 


@Evendo wrote:

I tried to used refer and realized that it could link data but the pulldown is displayed ID value only, not the value I want.

That mean, I want to display [Rank].[Rank Name] at the pulldown but to save the corresponding [Rank].[Rank ID] (defined at [Rank] master table) into [User].[Rank ID] when register the form.


You should be able to do so. It requires:

- the column [user] to be set with type Ref, and its source table to the table User

- same with column[rank] and table Rank

- and so on

Please keep in mind that when using Ref type, the id is registered. If you need to grab some other attributes, you could use chained dereferenced expression, such as: 

 

[user].[rankid].[rankname]

 

 

For reference:

Dereference expressions - AppSheet Help

 

 

Top Labels in this Space