How to save a name instead of the ID Hey Tea...

(Tyson Carmichael (FlyTy)) #1

How to save a name instead of the ID

Hey Team,

I have 2 tables. Process Groups and Processes.

When adding a new process in the processes table, I select the process group from a drop down (ref from Process groups table),

then I type in the process name.

When the record is saved in the processes table, I notice it saved the Process Group ID instead of the process group name.

What change do I need to make for it to save the process group name instead of the process group ID in my processes table?

Thanks

(Praveen Seshadri (AppSheet)) #2

Hi Tyson, you can’t do that. A ref column must store a key of the referenced table. Because it the key that uniquely identifies the row in the other table. The group name may not be unique. If the group name is indeed unique, then make that the key of the Groups table.

(Syed Faheemuddin) #3

In the ref type drop-down, the list displayed is the column from the referenced table which is selected as label. But the value of Column is taken which is selected as key.

Now 2 possible solutions 1. Make process group name as key or 2. Add a new virtual column with formula [process group ID].[Process group name]

(Tyson Carmichael (FlyTy)) #4

@praveen@Sdfaheemuddin Thanks alot! I appreciate the clarity and suggested solutions

(Syed Faheemuddin) #5

@praveen didn’t see your post coming Happy to help

(Tyson Carmichael (FlyTy)) #6

Hey @praveen@Sdfaheemuddin Here’s a followup question. Since the ref saves the Process group ID instead of the Process name how can I create a dependent drop down list based on this table?

For example, suppose I created a third table called Process details referencing the process group and process name saved in the processes table. After selecting a process group from the drop down in the process details table how would it show only the process names based on that selection since that field contains an ID and not a name?

I created dependent dropdowns before using the validif but this is the first time I am meeting this scenario using ref.

(Syed Faheemuddin) #7

It’s little confusing. But if I am right, Create a virtual column in processes table dereferencing to process group. Then dereference virtual column from process details

(Tyson Carmichael (FlyTy)) #8

Yea, a picture would have been better to illustrate. I’ll try your suggestion. Thanks