Look up expression for ref column

Hi all, I have table โ€œClientโ€ ,table โ€œPotential Clientโ€ and table โ€œPeopleโ€ , Table โ€œPeopleโ€ referenced to table โ€œClientโ€ ,and table โ€œPotential Clientโ€

Is there a way when I add new โ€œPeopleโ€ in form,when we choose โ€œPotential Client IDโ€ (a reference column), the other column [Client ID] (also ref column with โ€œPeopleโ€ table, will automatic filled (just as dereference) when โ€œPotential Client IDโ€ is [Client ID] (potential client become client ).

I think about to have a look up expression for [Client ID]. But dont know how to do.

Thanks !

Solved Solved
0 16 239
1 ACCEPTED SOLUTION

As per understanding, finding a key that is unique in a table from other values through LOOKUP() could be an issue because there is a possibility of other values being repeated in a table.

Anyway, you may wish to try the below.

Please create a column in the "People " table called [Potential Client Name] with the expression [Potential Client ID].[Potemtial Client Name]

Then the lookup for [Client ID] in the โ€œPeopleโ€ table can be

LOOKUP([_THISROW].[Potential Client Name], โ€œClientโ€, โ€œClient Nameโ€ , โ€œClient IDโ€)

View solution in original post

16 REPLIES 16

If you could better describe your requirement, the community could help you better.

I will describe It
Table Client
3X_e_b_eb2844caf75e4afb10a11611d23edc5362138add.png
table โ€œPotential Clientโ€
3X_1_3_1322ff218c9f82e0ed8611282253e58f09863111.png
Table People
3X_c_f_cfb7580aba176f707345be4845680492ec74841e.png
Table โ€œPeopleโ€ referenced to table โ€œClientโ€ ,and table โ€œPotential Clientโ€ . in Form of of table People, Is there a way automatic filled the red cell (The value shoud be ClientID001 )
Hope It clear, thanks

As per understanding, finding a key that is unique in a table from other values through LOOKUP() could be an issue because there is a possibility of other values being repeated in a table.

Anyway, you may wish to try the below.

Please create a column in the "People " table called [Potential Client Name] with the expression [Potential Client ID].[Potemtial Client Name]

Then the lookup for [Client ID] in the โ€œPeopleโ€ table can be

LOOKUP([_THISROW].[Potential Client Name], โ€œClientโ€, โ€œClient Nameโ€ , โ€œClient IDโ€)

Thanks @Suvrutt_Gurjar and @Aurelien , may I ask
why not LOOKUP([Potential Client ID].[Potential Client Name], โ€œClientโ€, โ€œClient Nameโ€ , โ€œClient IDโ€) but LOOKUP([_THISROW].[Potential Client Name], โ€œClientโ€, โ€œClient Nameโ€ , โ€œClient IDโ€) . I always confused about [_THISROW]

You may want to read this

Short explanation:
In a row evaluation:
LOOKUP([_THISROW].[Potential Client Name], โ€œClientโ€, โ€œClient Nameโ€ , โ€œClient IDโ€)
is equivalent to:
LOOKUP([Potential Client Name], โ€œClientโ€, โ€œClient Nameโ€ , โ€œClient IDโ€)
ifโ€ฆ[Potential Client Name] is in the same table.

This:
LOOKUP([Potential Client ID].[Potential Client Name], โ€œClientโ€, โ€œClient Nameโ€ , โ€œClient IDโ€)
is looking for [Potential Client Name] value, in the table of Clients, based on the value of [Potential Client ID], as it belongs to it. This is called a dereferenced expression.

Sorry may I ask one more question: if I use this expression
LOOKUP([Potential Client ID].[Potential Client Name], โ€œClientโ€, โ€œClient Nameโ€ , โ€œClient IDโ€)
then I dont have to create a column in the "People " table called [Potential Client Name] with the expression [Potential Client ID].[Potemtial Client Name]. Right ?

correct.

Great, thank you @Aurelien . Words could not descibe my gratitude for you

You are welcome

Hi @Aurelien,sorry one more question. What if [Potential Client Name] not in the same table, then how to identify [_THISROW].[Potential Client Name] ? Is it the mean the column [Potential Client Name] from the table that referenced to table โ€œPeopleโ€ ? If that is the case, then we can still donโ€™t need to create a column in the "People " table called [Potential Client Name] with the expression [Potential Client ID].[Potemtial Client Name] right ?

Thanks

Hi @Phong_Lam

I suggest you read this in order to get more information about [_THISROW] and LOOKUP() expression:

Aurelien
Google Developer Expert
Google Developer Expert

Hi @Phong_Lam

You question is unclear to me, @Suvrutt_Gurjar is right and he is suggesting a good solution.

May I ask wahtโ€™s the difference between Client and Potential Client ?
If itโ€™s just a matter of status, like โ€œpotential/realโ€, you may want to merge the two tables.
So, your table People would use, instead of LOOKUP(), the expression:
IF([Status]="real", [Client_ID],"")

The reason to do this because below table โ€œPotential Clientโ€ , and โ€œClientโ€ have inline view of People related to โ€œPotential Clientโ€ , and โ€œClientโ€. So I just dont want to choose twiceโ€ฆ
Yes. โ€œPotential Clientโ€ have status โ€œactive client/met/not approachedโ€ฆโ€
I am thinking should I merge those 2 tables โ€ฆBecause it have difference references thingsโ€ฆ

You could use Slices.

Client_Potential, row filter condition [status]="not approached"
Client_Met, row filter condition [status]="Met"
Client_Active, row filter condition [status]="Active"
and so on

I donโ€™t get it, can you explain further ?

I mean below table โ€œPotential Clientโ€ , and โ€œClientโ€ have inline view of People related to โ€œPotential Clientโ€ , and โ€œClientโ€


so when you press โ€œaddโ€ people there will have a form, already ref to โ€œPotential Clientโ€ or โ€œClientโ€, If that below โ€œPotential Clientโ€ , then I dont have to choose for โ€œClient IDโ€ in the dropdown again.
Slice is a good idea, can I do a different view for a โ€œClientโ€ slice than the table โ€œPotential Clientโ€ ?

Thatโ€™s, I would say, one of the main advantage of it

About the Add: if the slice is read-only, you will not have the Add button (you may preferrently set the update mode to โ€œupdateโ€)

Top Labels in this Space