Using Unique User ID value from one table as primary key value in all other tables

Hi, When user registers with their email, a unique ID is created using UNIQUEID expression (i.e., Table A / Form A). After the user has registered, the user needs to fill out other forms from other tables (i.e. Form B from Table B - ProfileID).

Based on my searching, it seems I should use the SELECT expression to reference Table A, such as SELECT(Users[UniqueID],[Email] = USEREMAIL(), TRUE)), I have entered this into the ProfileID for Table B, but it says it is an error.

Question: how can I make the primary key value in another table use the same unique ID created when the user registers? So, the UniqueID value is the same as the ProfileID value.

Hope this makes sense. Thanks.

Regards,
Jonathan

0 3 419
3 REPLIES 3

Aurelien
Google Developer Expert
Google Developer Expert

Hi @Jonathan_Lance

SELECT will return a list.
You are probably looking for a single item.

What if you wrap your SELECT statement with an ANY() ?
At doing so, youโ€™ll have:

ANY(
  SELECT(
    Users[UniqueID],
    [Email] = USEREMAIL(), 
    TRUE
  )
)

Or, equivalent expression:

LOOKUP(
  "Users", 
  USEREMAIL(), 
  "Email", 
  "UniqueID"
)

Somehow, what you are doing looks a little complex.
What if you use the email as a key_column, with USEREMAIL() as initial value, instead of creating an UNIQUEID() expression ?

Hi Aurelien,

Thanks for the response. WIll try out the two methods you shared. Also, was thinking about using the email address as the key value throughout the other tables. Will revert with what I find out.

Regards,
Jonathan

Steve
Platinum 4
Platinum 4
Top Labels in this Space